From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77D6F3BED59 for ; Tue, 18 Aug 2026 09:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787044952; cv=none; b=GEYrP2hBYVTbeLVUgTWXUvYAxUiDMcygM6oKsZMLjYzoNqFSFkWyDAP0YyZxqK7YsAYZjVMJqH6MGSXTMsbuJnqPlKovcyE5Z5taTHr4A59w174qq0j+Mr3l3QVXC7QRnwiBGf6JIpE/DhuBwDVfNwFupTpRnMyg6yDwDp8cyCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787044952; c=relaxed/simple; bh=IsEOygGtfFLHYmbUDLsIQtZMoWYKY4eGibyUiU33wNg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=VI9/u82nRR9e/uibFAkotmeuI4p8k3bz25QOowtjq6ADx0WHW4/QcKEL28q1EYpU++nRWicYK7F8T7klm0c0kinvTlnOECzOQrCgAG7kfnSfsCMf9bNJ3sXNPaKfXaua0osMTTQgRPMQ4NgfZS7b/XGCT2coqwWFRQKa++SWWrw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EqIFEqJP; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EqIFEqJP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787044949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kSRhIRY7DhW+zYPGde8sb9EbsmtFd08VqSJIXF3N0po=; b=EqIFEqJPGkg9wdJ6Lgs6BoEqd6D9c75wSjSEsOaaKzTSu2pK6BrnOLS3v8pm5/Sl7qwdNl yR0RYHPp/HXh15GNHd1aunUi64PzuPhtthP0otA3oYtrf7s99URP16CJb/IlVsW0HOr1qg HTNL6mmNIM37m/RjVj+OJoS726ugH6M= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-5KoqOPY-NUePqti-6YtenA-1; Tue, 18 Aug 2026 05:22:27 -0400 X-MC-Unique: 5KoqOPY-NUePqti-6YtenA-1 X-Mimecast-MFC-AGG-ID: 5KoqOPY-NUePqti-6YtenA_1787044947 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DEBB41800D80; Tue, 18 Aug 2026 09:22:25 +0000 (UTC) Received: from [10.44.48.124] (unknown [10.44.48.124]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E4D2B434; Tue, 18 Aug 2026 09:22:23 +0000 (UTC) Date: Tue, 18 Aug 2026 11:22:18 +0200 (CEST) From: Mikulas Patocka To: Yu Junzhe cc: Mike Snitzer , Benjamin Marzinski , Alasdair Kergon , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [BUG] dm: unbounded recursion in dm_blk_ioctl via cyclic DM stacking In-Reply-To: <20260818075627.322-1-junzheyu1@gmail.com> Message-ID: References: <20260818075627.322-1-junzheyu1@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 On Tue, 18 Aug 2026, Yu Junzhe wrote: > Hello, > > I am reporting unbounded recursion in dm_blk_ioctl(): it forwards a > block ioctl to the underlying device with no depth or cycle guard. A > two-device DM-on-DM cycle then re-enters dm_blk_ioctl until the kernel > stack is exhausted. Hi There is also unbounded recursion in bio_endio when stacking bio-based drivers. Many years ago I tried to fix it, but there was no intereset in fixing it. If you work with block maintainers to fix the bio_endio recursion, I can fix the dm_blk_ioctl case. > Table load rejects only a device mapped onto itself (dm_get_device: dev > == disk_devt(t->md->disk)). A->B->A is accepted. bd_link_disk_holder > rejects only a disk holding itself. Regarding A->B->A stacking - the user just shouldn't do recursive stacking. Mikulas