1 Star 0 Fork 99

陈亚强/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
grub-core-loader-efi-fdt.c-Do-not-copy-random-memory.patch 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:52 . Package init
From ad0ea7c444234ca519a3b528ddc70fff45810e25 Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <[email protected]>
Date: Mon, 17 Dec 2018 22:00:24 +0100
Subject: [PATCH 239/270] grub-core/loader/efi/fdt.c: Do not copy random memory
We should not try to copy any memory area which is outside of the original
fdt. If this extra memory is controlled by a hypervisor this might end
with a crash.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Leif Lindholm <[email protected]>
Reviewed-by: Daniel Kiper <[email protected]>
---
grub-core/loader/efi/fdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c
index a18ca8c..ee9c559 100644
--- a/grub-core/loader/efi/fdt.c
+++ b/grub-core/loader/efi/fdt.c
@@ -66,7 +66,7 @@ grub_fdt_load (grub_size_t additional_size)
if (raw_fdt)
{
- grub_memmove (fdt, raw_fdt, size);
+ grub_memmove (fdt, raw_fdt, size - additional_size);
grub_fdt_set_totalsize (fdt, size);
}
else
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yaqiangchen/grub2.git
[email protected]:yaqiangchen/grub2.git
yaqiangchen
grub2
grub2
master

搜索帮助