SHA256
1
0
forked from pool/grub2

Accepting request 635497 from home:michael-chang:bsc:1084508

- Fix broken network interface with random address and same name (bsc#1084508) 
  * 0001-ofnet-Initialize-structs-in-bootpath-parser.patch

OBS-URL: https://build.opensuse.org/request/show/635497
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=314
This commit is contained in:
Marcus Meissner 2018-09-13 14:20:59 +00:00 committed by Git OBS Bridge
parent d37f9a340e
commit 71b1f4f139
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,36 @@
From ddd47864e98cb32a718075bab4462dc56919ec6c Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <julian.klode@canonical.com>
Date: Mon, 3 Sep 2018 10:09:15 +0200
Subject: [PATCH] ofnet: Initialize structs in bootpath parser
Code later on checks if variables inside the struct are
0 to see if they have been set, like if there were addresses
in the bootpath.
The variables were not initialized however, so the check
might succeed with uninitialized data, and a new interface
with random addresses and the same name is added. This causes
$net_default_mac to point to the random one, so, for example,
using that variable to load per-mac config files fails.
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1785859
Signed-off-by: Julian Andres Klode <julian.klode@canonical.com>
---
grub-core/net/drivers/ieee1275/ofnet.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: grub-2.02/grub-core/net/drivers/ieee1275/ofnet.c
===================================================================
--- grub-2.02.orig/grub-core/net/drivers/ieee1275/ofnet.c
+++ grub-2.02/grub-core/net/drivers/ieee1275/ofnet.c
@@ -153,8 +153,8 @@ grub_ieee1275_parse_bootpath (const char
char *comma_char = 0;
char *equal_char = 0;
grub_size_t field_counter = 0;
- grub_net_network_level_address_t client_addr, gateway_addr, subnet_mask;
- grub_net_link_level_address_t hw_addr;
+ grub_net_network_level_address_t client_addr = {}, gateway_addr = {}, subnet_mask = {};
+ grub_net_link_level_address_t hw_addr = {};
grub_net_interface_flags_t flags = 0;
struct grub_net_network_level_interface *inter = NULL;
grub_uint32_t vlantag = 0;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Sep 13 08:38:01 UTC 2018 - mchang@suse.com
- Fix broken network interface with random address and same name (bsc#1084508)
* 0001-ofnet-Initialize-structs-in-bootpath-parser.patch
-------------------------------------------------------------------
Fri Aug 31 10:06:56 UTC 2018 - mchang@suse.com

View File

@ -257,6 +257,7 @@ Patch212: grub2-install-remove-useless-check-PReP-partition-is-empty.patch
Patch213: grub2-Fix-incorrect-netmask-on-ppc64.patch
Patch214: grub2-ieee1275-open-raw-mode.patch
Patch215: grub2-ppc64-cas-new-scope.patch
Patch216: 0001-ofnet-Initialize-structs-in-bootpath-parser.patch
Patch233: grub2-use-stat-instead-of-udevadm-for-partition-lookup.patch
Patch234: fix-grub2-use-stat-instead-of-udevadm-for-partition-lookup-with-new-glibc.patch
Patch236: grub2-efi_gop-avoid-low-resolution.patch
@ -546,6 +547,7 @@ swap partition while in resuming
%patch213 -p1
%patch214 -p1
%patch215 -p1
%patch216 -p1
%patch233 -p1
%patch234 -p1
%patch236 -p1