From e6a540416cc9bc696f5d764c481506feda4f62b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Mon, 14 Nov 2022 04:19:34 +0100 Subject: [PATCH] libblkid: f2fs: fix unaligned access --- libblkid/src/superblocks/f2fs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libblkid/src/superblocks/f2fs.c b/libblkid/src/superblocks/f2fs.c index 3a2924d910..ce796098ae 100644 --- a/libblkid/src/superblocks/f2fs.c +++ b/libblkid/src/superblocks/f2fs.c @@ -62,6 +62,8 @@ static int f2fs_validate_checksum(blkid_probe pr, size_t sb_off, uint32_t csum_off = le32_to_cpu(sb->checksum_offset); if (!csum_off) return 1; + if (csum_off % sizeof(uint32_t) != 0) + return 0; if (csum_off + sizeof(uint32_t) > 4096) return 0; -- 2.47.3