1 Star 0 Fork 100

ridedolphin/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-kern-fs-Fix-possible-integer-overflow-in-i386-pc-mode-with-large.patch 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
zhangqiumiao 提交于 2023-04-10 22:22 . backport some patches from upstream
From 1a241e050652472efa62b2b36ad2fa7f82427b83 Mon Sep 17 00:00:00 2001
From: Maxim Fomin <maxim@fomin.one>
Date: Wed, 28 Dec 2022 17:40:06 +0000
Subject: kern/fs: Fix possible integer overflow in i386-pc mode with large
partitions
The i386-pc mode supports MBR partition scheme where maximum partition
size is 2 TiB. In case of large partitions left shift expression with
unsigned long int "length" object may cause integer overflow making
calculated partition size less than true value. This issue is fixed by
increasing the size of "length" integer type.
Reference:https://git.savannah.gnu.org/cgit/grub.git/commit?id=1a241e050652472efa62b2b36ad2fa7f82427b83
Conflict:NA
Signed-off-by: Maxim Fomin <maxim@fomin.one>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/kern/fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/kern/fs.c b/grub-core/kern/fs.c
index b950829..7ad0aaf 100644
--- a/grub-core/kern/fs.c
+++ b/grub-core/kern/fs.c
@@ -130,7 +130,7 @@ grub_fs_probe (grub_device_t device)
struct grub_fs_block
{
grub_disk_addr_t offset;
- unsigned long length;
+ grub_disk_addr_t length;
};
static grub_err_t
--
cgit v1.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ridedolphin/grub2.git
git@gitee.com:ridedolphin/grub2.git
ridedolphin
grub2
grub2
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385