Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fsoUL-0000tW-Du for mharc-grub-devel@gnu.org; Thu, 23 Aug 2018 08:13:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsoUJ-0000si-9B for grub-devel@gnu.org; Thu, 23 Aug 2018 08:13:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsoUG-0000UH-2R for grub-devel@gnu.org; Thu, 23 Aug 2018 08:13:19 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsoUF-0000TZ-QU for grub-devel@gnu.org; Thu, 23 Aug 2018 08:13:15 -0400 Received: from mail-wm0-f72.google.com ([74.125.82.72]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fsoUE-0006EB-NL for grub-devel@gnu.org; Thu, 23 Aug 2018 12:13:14 +0000 Received: by mail-wm0-f72.google.com with SMTP id z11-v6so4340754wma.4 for ; Thu, 23 Aug 2018 05:13:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QanJo+vt016fdWcDGsizYhVRP/p5FHgkmj+c6MxYddY=; b=qK7Cr5bwl9pubQbut5TNRsoj0j/mY/ncoHQ1Vkeo/35q2q+xoeWzni3VMKP0WVP3va XWEdZXvKpyAgxNVKkcxeC5+tT4OSER5BrZHxo6BAXi/XqW94cVYnxE4gk5gOI+gCvec9 nUzCgD7juMgbVsIh5dptrdfUYYC+G/+gi6EiudCKGEIv0J53xlhnCy4EMt7IJdlDxqp5 +if/IoEURtIkEns47rWAk7mIwhHULwD2R7uHVCZDL9euCndDNRLu6xbA3EHImnNkD6kn P5Jyd+eDBgi6Ic1+WCJbigO2cc6zG+QBWQiE48Vg/6qw/E2aWVSNWGllXjgytoUGflhu QzVg== X-Gm-Message-State: APzg51BKqA1teTEsFivJjHQUCRjrDzeJ3f8e3DW/9rhTrWVeBzDJaG8z qSdC6nisqHonyAeFZPUc9j/2KtbkAKnLsi6WkqPtXescLzJdgO0gq2GN6t8AUZ2YK5t+JsbnagZ gWGREIkU2TAPPAqW9JjRiY2eD+eJO X-Received: by 2002:a1c:ee15:: with SMTP id m21-v6mr5170160wmh.112.1535026394141; Thu, 23 Aug 2018 05:13:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZay2rSOOip/v8/0J2XTKX4aQtu3X6qKBxj88Npw6iUes9kVwlPPX5+XuvYdhjq8E/rYKasCw== X-Received: by 2002:a1c:ee15:: with SMTP id m21-v6mr5170152wmh.112.1535026393922; Thu, 23 Aug 2018 05:13:13 -0700 (PDT) Received: from jak-t480s.lan (HSI-KBW-095-208-058-169.hsi5.kabel-badenwuerttemberg.de. [95.208.58.169]) by smtp.gmail.com with ESMTPSA id z16-v6sm3397698wrq.78.2018.08.23.05.13.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 05:13:13 -0700 (PDT) From: Julian Andres Klode To: grub-devel@gnu.org Cc: Julian Andres Klode Subject: [PATCH resend] ofnet: Initialize structs in bootpath parser Date: Thu, 23 Aug 2018 14:12:56 +0200 Message-Id: <20180823121256.16764-1-julian.klode@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180823114617.gxwxkvqqxlpnktsh@jak-t480s> References: <20180823114617.gxwxkvqqxlpnktsh@jak-t480s> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 91.189.89.112 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2018 12:13:20 -0000 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 suceed with uninitialized data, and a new interface with random addresses has been added. This caused a weird bug in Ubuntu, because when booting from network, we now had two interfaces with the same name, and net_default_mac pointed to the random one. Bug-Ubuntu: https://bugs.launchpad.net/bugs/1785859 Signed-off-by: Julian Andres Klode --- grub-core/net/drivers/ieee1275/ofnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c index 002446be1..00abc64bb 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -153,8 +153,8 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, 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_uint16_t vlantag = 0; -- 2.17.1