mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yingjie Wang <x-professor@outlook.com>
To: Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Benjamin Marzinski <bmarzins@redhat.com>
Cc: "dm-devel@lists.linux.dev" <dm-devel@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Damien Le Moal <dlemoal@kernel.org>,
	Hannes Reinecke <hare@suse.de>, Dan Carpenter <error27@gmail.com>,
	Yingjie Wang <x-professor@outlook.com>
Subject: [PATCH 0/3] dm zoned: fix metadata recovery and a tertiary superblock crash
Date: Mon, 30 Nov 2026 16:14:37 +0000	[thread overview]
Message-ID: <20261130161425.3535695-1-x-professor@outlook.com> (raw)

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

             reply	other threads:[~2026-11-30 16:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 16:14 Yingjie Wang [this message]
2026-11-30 16:17 ` [PATCH 1/3] dm zoned: fix invalid free when reading a tertiary superblock fails Yingjie Wang
2026-11-30 16:17 ` [PATCH 2/3] dm zoned: check the metadata zones before recovering a metadata set Yingjie Wang
2026-11-30 16:17 ` [PATCH 3/3] dm zoned: fix the search for the secondary superblock Yingjie Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130161425.3535695-1-x-professor@outlook.com \
    --to=x-professor@outlook.com \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dlemoal@kernel.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=error27@gmail.com \
    --cc=hare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®