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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
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();