From c4dad3d846bb715dbf0fb177ae3ca196139eb60e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 1 Oct 2023 11:48:01 +0200 Subject: [PATCH] libblkid: (lvm2) read complete superblock MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The lvm2_calc_crc() will create a checksum over LVM2_LABEL_SIZE bytes, which all need to be read. Currently this works because the superblock is cached by blkid_probe_get_idmag() which always reads 1024 bytes. Signed-off-by: Thomas Weißschuh --- libblkid/src/superblocks/lvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libblkid/src/superblocks/lvm.c b/libblkid/src/superblocks/lvm.c index 71ca132021..fdd9cd6d7a 100644 --- a/libblkid/src/superblocks/lvm.c +++ b/libblkid/src/superblocks/lvm.c @@ -80,7 +80,7 @@ static int probe_lvm2(blkid_probe pr, const struct blkid_idmag *mag) buf = blkid_probe_get_buffer(pr, mag->kboff << 10, - 512 + sizeof(struct lvm2_pv_label_header)); + 512 + LVM2_LABEL_SIZE); if (!buf) return errno ? -errno : 1; -- 2.47.2