代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Thomas Frauendorfer | Miray Software <tf@miray.de>
Date: Tue, 4 Aug 2020 17:13:05 +0200
Subject: [PATCH] efi/net: Fix malformed device path arithmetic errors in efi
net methods
---
grub-core/net/efi/net.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c
index 3ae1fbbe3..a58c24f63 100644
--- a/grub-core/net/efi/net.c
+++ b/grub-core/net/efi/net.c
@@ -1318,11 +1318,18 @@ grub_efi_net_boot_from_https (void)
dp = grub_efi_get_device_path (image->device_handle);
- while (1)
+ while (dp)
{
+ grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp);
+ if (len < 4)
+ {
+ grub_error(GRUB_ERR_OUT_OF_RANGE,
+ "malformed EFI Device Path node has length=%d", len);
+ break;
+ }
+
grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp);
grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp);
- grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp);
if ((type == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE)
&& (subtype == GRUB_EFI_URI_DEVICE_PATH_SUBTYPE))
@@ -1335,7 +1342,7 @@ grub_efi_net_boot_from_https (void)
if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp))
break;
- dp = (grub_efi_device_path_t *) ((char *) dp + len);
+ dp = GRUB_EFI_NEXT_DEVICE_PATH(dp);
}
return 0;
@@ -1353,11 +1360,18 @@ grub_efi_net_boot_from_opa (void)
dp = grub_efi_get_device_path (image->device_handle);
- while (1)
+ while (dp)
{
+ grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp);
+ if (len < 4)
+ {
+ grub_error(GRUB_ERR_OUT_OF_RANGE,
+ "malformed EFI Device Path node has length=%d", len);
+ break;
+ }
+
grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp);
grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp);
- grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp);
if ((type == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE)
&& (subtype == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE))
@@ -1368,7 +1382,7 @@ grub_efi_net_boot_from_opa (void)
if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp))
break;
- dp = (grub_efi_device_path_t *) ((char *) dp + len);
+ dp = GRUB_EFI_NEXT_DEVICE_PATH(dp);
}
return 0;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。