mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] dm zoned: fix the validation of the superblocks
@ 2026-12-01 10:56 Yingjie Wang
  2026-12-01 10:56 ` [PATCH 1/3] dm zoned: do not update metadata state from an invalid superblock Yingjie Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yingjie Wang @ 2026-12-01 10:56 UTC (permalink / raw)
  To: Alasdair Kergon, Mike Snitzer, Mikulas Patocka, Benjamin Marzinski
  Cc: dm-devel, linux-kernel, Damien Le Moal, Hannes Reinecke, Yingjie Wang

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-01 12:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 10:56 [PATCH 0/3] dm zoned: fix the validation of the superblocks Yingjie Wang
2026-12-01 10:56 ` [PATCH 1/3] dm zoned: do not update metadata state from an invalid superblock Yingjie Wang
2026-12-01 10:56 ` [PATCH 2/3] dm zoned: validate the metadata layout in the superblock Yingjie Wang
2026-12-01 10:56 ` [PATCH 3/3] dm zoned: handle labels that are not NUL-terminated Yingjie Wang
2026-12-01 11:06   ` Damien Le Moal
2026-12-01 12:15     ` Yingjie Wang

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®