加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-net-arp-Fix-uninitialized-scalar-variable.patch 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
From 6bb551db112a6d7509d5633be103fe3ee1e09f37 Mon Sep 17 00:00:00 2001
From: Alec Brown <alec.r.brown@oracle.com>
Date: Mon, 21 Mar 2022 02:28:58 -0400
Subject: net/arp: Fix uninitialized scalar variable
In the function grub_net_arp_receive(), grub_net_network_level_address_t
sender_addr and target_addr are being called but aren't being initialized.
In both of these structs, each member is being set to a value except for
grub_dns_option_t option. This results in this member being filled with junk
data from the stack. To prevent this, we can set the option member in both
structs to 0.
Fixes: CID 375030
Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Conflict:Context adaptation
Reference:https://git.savannah.gnu.org/cgit/grub.git/commit?id=6bb551db112a6d7509d5633be103fe3ee1e09f37
---
grub-core/net/arp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c
index 54306e3..1d36743 100644
--- a/grub-core/net/arp.c
+++ b/grub-core/net/arp.c
@@ -128,6 +128,8 @@ grub_net_arp_receive (struct grub_net_buff *nb, struct grub_net_card *card,
grub_uint8_t pln;
grub_uint8_t arp_packet_len;
grub_uint8_t *tmp_ptr;
+ sender_addr.option = 0;
+ target_addr.option = 0;
hw_type = card->default_address.type;
hln = card->default_address.len;
--
cgit v1.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化