From: "Darrick J. Wong" <djwong@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: linux-xfs@vger.kernel.org, hch@lst.de
Subject: [PATCH 2/2] xfs_db: obfuscate rt superblock label when metadumping
Date: Tue, 18 Feb 2025 20:08:49 -0800 [thread overview]
Message-ID: <20250219040849.GM21808@frogsfrogsfrogs> (raw)
In-Reply-To: <20250219040813.GL21808@frogsfrogsfrogs>
From: Darrick J. Wong <djwong@kernel.org>
Metadump can obfuscate the filesystem label on all the superblocks on
the data device, so it must perform the same transformation on the
realtime device superblock to avoid leaking information and so that the
mdrestored filesystem is consistent.
Found by running xfs/503 with realtime turned on and a patch to set
labels on common/populated filesystem images.
Cc: <linux-xfs@vger.kernel.org> # v6.13.0
Fixes: 6bc20c5edbab51 ("xfs_db: metadump realtime devices")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
db/metadump.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/db/metadump.c b/db/metadump.c
index 4f4b4f8a39a551..4d090942bf29cd 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -3073,6 +3073,17 @@ copy_rtsb(void)
print_warning("cannot read realtime superblock");
return !metadump.stop_on_read_error;
}
+
+ /* Replace any filesystem label with "L's" */
+ if (metadump.obfuscate) {
+ struct xfs_rtsb *rtsb = iocur_top->data;
+
+ memset(rtsb->rsb_fname, 'L',
+ min(strlen((char *)rtsb->rsb_fname),
+ sizeof(rtsb->rsb_fname)));
+ iocur_top->need_crc = 1;
+ }
+
error = write_buf(iocur_top);
pop_cur();
next prev parent reply other threads:[~2025-02-19 4:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 4:08 [PATCH 1/2] mkfs,xfs_repair: don't pass a daddr as the flags argument Darrick J. Wong
2025-02-19 4:08 ` Darrick J. Wong [this message]
2025-02-19 5:37 ` [PATCH 2/2] xfs_db: obfuscate rt superblock label when metadumping Christoph Hellwig
2025-02-19 5:37 ` [PATCH 1/2] mkfs,xfs_repair: don't pass a daddr as the flags argument Christoph Hellwig
2025-02-19 5:45 ` Darrick J. Wong
2025-02-19 5:48 ` Christoph Hellwig
2025-02-19 5:53 ` Darrick J. Wong
2025-02-19 5:46 ` [PATCH v1.1 " Darrick J. Wong
2025-02-19 5:49 ` Christoph Hellwig
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=20250219040849.GM21808@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=aalbersh@kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.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