14604f
From 7180c1ad36a1f419e20e90ddfad0b2f77d8c018f Mon Sep 17 00:00:00 2001
14604f
From: Karel Zak <kzak@redhat.com>
14604f
Date: Thu, 2 Jun 2022 16:02:54 +0200
14604f
Subject: libblkid: (mac) make sure block size is large enough [fuzzing]
14604f
14604f
Upstream: http://github.com/util-linux/util-linux/commit/4e12fbca62be10b09503cecc7507757874043474
14604f
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2060030
14604f
Reported-by: Thibault Guittet <tguittet@redhat.com>
14604f
Signed-off-by: Karel Zak <kzak@redhat.com>
14604f
---
14604f
 libblkid/src/partitions/mac.c | 2 ++
14604f
 1 file changed, 2 insertions(+)
14604f
14604f
diff --git a/libblkid/src/partitions/mac.c b/libblkid/src/partitions/mac.c
14604f
index 092d31d32..75a558b0a 100644
14604f
--- a/libblkid/src/partitions/mac.c
14604f
+++ b/libblkid/src/partitions/mac.c
14604f
@@ -93,6 +93,8 @@ static int probe_mac_pt(blkid_probe pr,
14604f
 	}
14604f
 
14604f
 	block_size = be16_to_cpu(md->block_size);
14604f
+	if (block_size < sizeof(struct mac_partition))
14604f
+		goto nothing;
14604f
 
14604f
 	/* The partition map always begins at physical block 1,
14604f
 	 * the second block on the disk.
14604f
-- 
14604f
2.36.1
14604f