All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] dm zoned: fix the validation of the superblocks
@ 2026-12-03  9:02 Yingjie Wang
  2026-12-03  9:02 ` [PATCH v2 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-03  9:02 UTC (permalink / raw)
  To: Alasdair Kergon, Mike Snitzer, Mikulas Patocka,
	Benjamin Marzinski
  Cc: dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	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.

Changes in v2:
- Patch 3: the code is unchanged.  Fix the commit message: dmzadm 2.0.0
  to 2.1.3 do create labels that are not NUL-terminated (Damien).
- Add Damien's Reviewed-by to patches 1 and 2.

v1: https://lore.kernel.org/dm-devel/20261201105558.117053-1-x-professor@outlook.com/

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-05  6:21 UTC | newest]

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.