[PATCH 0/3] dm zoned: fix the validation of the superblocks
From: Yingjie Wang
Date: Tue Dec 01 2026 - 05:56:11 EST
Patch 1 fixes dmz_check_sb() changing the metadata version, UUIDs and
label before it knows that the superblock is valid. An invalid
secondary superblock can thereby make the volume unusable.
Patch 2 adds the missing checks of the metadata layout. Without them, a
superblock with inconsistent sizes can result in an out-of-bounds write
when the table is loaded, and in metadata being written over data.
Patch 3 fixes a crash if the label is not NUL-terminated.
Tested with KASAN on null_blk devices, including fault injection, a
32-bit kernel, and volumes formatted with all dmzadm releases. All of
these problems were reproduced without the series and are gone with it.
Yingjie Wang (3):
dm zoned: do not update metadata state from an invalid superblock
dm zoned: validate the metadata layout in the superblock
dm zoned: handle labels that are not NUL-terminated
drivers/md/dm-zoned-metadata.c | 64 ++++++++++++++++++++++++----------
1 file changed, 45 insertions(+), 19 deletions(-)
base-commit: 2ee78e96ca1894cbfe00eff1e4ff24a93215337f
--
2.43.0