1 Star 0 Fork 25

dashnfschina/util-linux

forked from src-anolis-os/util-linux 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0080-libblkid-mac-make-sure-block-size-is-large-enough-fu.patch 1009 Bytes
一键复制 编辑 原始数据 按行查看 历史
renbo02 提交于 2023-01-30 16:56 . update to util-linux-2.32.1-39.el8_7
From 7180c1ad36a1f419e20e90ddfad0b2f77d8c018f Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 2 Jun 2022 16:02:54 +0200
Subject: libblkid: (mac) make sure block size is large enough [fuzzing]
Upstream: http://github.com/util-linux/util-linux/commit/4e12fbca62be10b09503cecc7507757874043474
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2060030
Reported-by: Thibault Guittet <tguittet@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libblkid/src/partitions/mac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libblkid/src/partitions/mac.c b/libblkid/src/partitions/mac.c
index 092d31d32..75a558b0a 100644
--- a/libblkid/src/partitions/mac.c
+++ b/libblkid/src/partitions/mac.c
@@ -93,6 +93,8 @@ static int probe_mac_pt(blkid_probe pr,
}
block_size = be16_to_cpu(md->block_size);
+ if (block_size < sizeof(struct mac_partition))
+ goto nothing;
/* The partition map always begins at physical block 1,
* the second block on the disk.
--
2.36.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dashnfschina/util-linux.git
git@gitee.com:dashnfschina/util-linux.git
dashnfschina
util-linux
util-linux
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385