[PATCH 0/3] dm zoned: fix metadata recovery and a tertiary superblock crash
From: Yingjie Wang
Date: Mon Nov 30 2026 - 11:14:48 EST
Patch 1 fixes an invalid free when the tertiary superblock of a zoned
device cannot be read. Dan Carpenter reported it as a double free after
an allocation failure. A read error also triggers it and results in a
NULL pointer dereference.
Patches 2 and 3 fix the recovery from the secondary superblock. With
some volumes formatted with dmzadm, for example on a 14 TB drive with
256 MiB zones, loading the table fails with -EIO if the primary
superblock is corrupted, although the secondary one is valid. Patch 3
fixes the search for it. Patch 2 is needed first, because the recovery
writes to the metadata zones before they are checked.
Tested with KASAN on null_blk devices, including fault injection and the
recovery of volumes formatted with dmzadm. All of these problems were
reproduced without the series and are gone with it.
Yingjie Wang (3):
dm zoned: fix invalid free when reading a tertiary superblock fails
dm zoned: check the metadata zones before recovering a metadata set
dm zoned: fix the search for the secondary superblock
drivers/md/dm-zoned-metadata.c | 49 +++++++++++++++++++---------------
1 file changed, 28 insertions(+), 21 deletions(-)
base-commit: 5feb56b402e9827d599b4076da9ad71c374b9ef5