Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nKuw5-00019j-GQ for mharc-grub-devel@gnu.org; Thu, 17 Feb 2022 23:32:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKuw4-00019Q-Bp for grub-devel@gnu.org; Thu, 17 Feb 2022 23:32:00 -0500 Received: from [2607:f8b0:4864:20::42c] (port=35725 helo=mail-pf1-x42c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKuw1-0001r0-UC for grub-devel@gnu.org; Thu, 17 Feb 2022 23:31:59 -0500 Received: by mail-pf1-x42c.google.com with SMTP id l19so1409183pfu.2 for ; Thu, 17 Feb 2022 20:31:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=FXuIhp9SQUAcQZMjZbb/Rlr+Xl5njEYYXaSV9611qkY=; b=Vg3u7IUW9zRDkxWjeAoOREino7zBuIkupPC8ZayLRYF8I7DozbpaG7Di0k9tdZtd0x i58pn//O8L8uPkh2OoUjKE5ZuynrabpRLYt/Hp/nJCrhhJPUlOqOWqgSX5vwfLLGVk9p c7fXYWkDUjTxc/Tl6NvdW8The1AEyFYRRKDC0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=FXuIhp9SQUAcQZMjZbb/Rlr+Xl5njEYYXaSV9611qkY=; b=YFHBWHkj7vIhcuRKRX/HeX6/MV65O4ZiAe35iKKiMRSFqjedukYcrC2tgg26exdAOP 30xFtN+WhBxLo19NilIHEyqWBGSQHTl8ICTLKVVvhps5nrMewz4aU5GzqyvG135mAVCC 2bqlSmAEXJyYI7p6HYYzACiDutnFjx7ZKFt8XmkZs7Uh+0wP2L+azX41SDsh/UTNd5AA SVQgAV4LgoMq0/v4PHNoQZFtLyimkQ+QgZ1Ia+5iUDjwJTo7xWelPncDwfbLJydIou1A C9w7hWSa0uMqVsaqZ1MLy1RSnD1MPV4uyapDxsoPGNNUD+fq1zildCwgKV5J9Dwy4AQ3 LDoA== X-Gm-Message-State: AOAM532X9W4uHOUgBDHHm2kl00XV+SbP3ispsApXpc86sGOiEfzh80ht 14v7sdFrDk2L0OV8/JojJcXEfsThy1lqLw== X-Google-Smtp-Source: ABdhPJxK9uNN9JHBzRqs2Ta0pxKOPHVAYlwhEH7oB0E8f/li+q6JtTugdwgZPzO0sNhFqa3Iu2mT7w== X-Received: by 2002:a05:6a00:21cd:b0:4e1:b09b:18e8 with SMTP id t13-20020a056a0021cd00b004e1b09b18e8mr6006518pfj.60.1645158715648; Thu, 17 Feb 2022 20:31:55 -0800 (PST) Received: from localhost ([2001:4479:e300:600:c38a:b773:8a85:833]) by smtp.gmail.com with ESMTPSA id v13sm1158072pfu.196.2022.02.17.20.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 20:31:55 -0800 (PST) From: Daniel Axtens To: Qiumiao Zhang via Grub-devel , grub-devel@gnu.org Cc: Qiumiao Zhang , fengtao40@huawei.com, rose.chen@huawei.com, yanan@huawei.com Subject: Re: [PATCH] net: fix null pointer dereference when parsing ICMP6_ROUTER_ADVERTISE messages In-Reply-To: <20220217134858.1997-1-zhangqiumiao1@huawei.com> References: <20220217134858.1997-1-zhangqiumiao1@huawei.com> Date: Fri, 18 Feb 2022 15:31:51 +1100 Message-ID: <87bkz4lrrc.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=dja@axtens.net; helo=mail-pf1-x42c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2022 04:32:00 -0000 Hi, I tested this against grub-emu and it fixed the crash I had observed. net_ls_addr reports an address as expected now also. Reviewed-by: Daniel Axtens Kind regards, Daniel Qiumiao Zhang via Grub-devel writes: > During UEFI PXE boot in IPv6 network, if the DHCP server adopts stateful automatic > configuration, when the client receives the ICMP6_ROUTER_ADVERTISE message multicast > from the server, it will cause the problem of dereference null pointer and cause > the grub2 program to crash. > > Fixes bug: https://savannah.gnu.org/bugs/index.php?62072 > --- > grub-core/net/icmp6.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c > index 2cbd95d..264fc4a 100644 > --- a/grub-core/net/icmp6.c > +++ b/grub-core/net/icmp6.c > @@ -477,7 +477,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, > > /* May not have gotten slaac info, find a global address on this > card. */ > - if (route_inf == NULL) > + if (route_inf == NULL && orig_inf != NULL) > { > FOR_NET_NETWORK_LEVEL_INTERFACES (inf) > { > -- > 2.19.1 > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel