]> www.infradead.org Git - users/hch/block.git/commit
dm: only call early_lookup_bdev from early boot context
authorChristoph Hellwig <hch@lst.de>
Sat, 20 May 2023 11:11:52 +0000 (13:11 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 31 May 2023 08:06:12 +0000 (10:06 +0200)
commit1c8eff4b093c024b06f8a038b013e746775c34e9
tree1d2e1a523d4b83a4ecdd7a89bff8f35c7dfe82d0
parentb24629052c928b269149170cdfffdb41e6335e28
dm: only call early_lookup_bdev from early boot context

early_lookup_bdev is supposed to only be called from the early boot
code, but dm_get_device calls it as a general fallback when lookup_bdev
fails, which is problematic because early_lookup_bdev bypasses all normal
path based permission checking, and might cause problems with certain
container environments renaming devices.

Switch to only call early_lookup_bdev when dm is built-in and the system
state in not running yet.  This means it is still available when tables
are constructed by dm-init.c from the kernel command line, but not
otherwise.

Note that this strictly speaking changes the kernel ABI as the PARTUUID=
and PARTLABEL= style syntax is now not available during a running
systems.  They never were intended for that, but this breaks things
we'll have to figure out a way to make them available again.  But if
avoidable in any way I'd rather avoid that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-table.c