mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Yu Junzhe <junzheyu1@gmail.com>
Cc: Mike Snitzer <snitzer@kernel.org>,
	 Benjamin Marzinski <bmarzins@redhat.com>,
	Alasdair Kergon <agk@redhat.com>,
	 dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [BUG] dm: unbounded recursion in dm_blk_ioctl via cyclic DM stacking
Date: Tue, 18 Aug 2026 11:22:18 +0200 (CEST)	[thread overview]
Message-ID: <c51ba72b-6fb6-2b66-ec9b-3211c0c3518e@redhat.com> (raw)
In-Reply-To: <20260818075627.322-1-junzheyu1@gmail.com>



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


      reply	other threads:[~2026-08-18  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  7:56 Yu Junzhe
2026-08-18  9:22 ` Mikulas Patocka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c51ba72b-6fb6-2b66-ec9b-3211c0c3518e@redhat.com \
    --to=mpatocka@redhat.com \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=junzheyu1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snitzer@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®