]> www.infradead.org Git - users/hch/block.git/commit
mtd: block2mtd: don't call early_lookup_bdev after the system is running
authorChristoph Hellwig <hch@lst.de>
Sat, 20 May 2023 11:37:27 +0000 (13:37 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 31 May 2023 08:06:12 +0000 (10:06 +0200)
commitd00d7867808bb0338403f0fbeafa4c7cc292e6c0
treee6114ff91a0b745b2ad6cb0e9c6efece9628c63b
parent71864ba3d52b8b62c05f5636b6dc5d7e53982323
mtd: block2mtd: don't call early_lookup_bdev after the system is running

early_lookup_bdev is supposed to only be called from the early boot
code, but mdtblock_early_get_bdev is called 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 block2mtd is built-in and the
system state in not running yet.

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: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/devices/block2mtd.c