From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Yk2XK-00044P-SG for mharc-grub-devel@gnu.org; Sun, 19 Apr 2015 23:38:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yk2XI-00044J-St for grub-devel@gnu.org; Sun, 19 Apr 2015 23:38:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yk2XD-0000LZ-Sd for grub-devel@gnu.org; Sun, 19 Apr 2015 23:38:16 -0400 Received: from mail-lb0-x236.google.com ([2a00:1450:4010:c04::236]:34722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yk2XD-0000LN-K2 for grub-devel@gnu.org; Sun, 19 Apr 2015 23:38:11 -0400 Received: by lbcga7 with SMTP id ga7so120805719lbc.1 for ; Sun, 19 Apr 2015 20:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=cLD8mH2cRsbuLB2xY5u2fqq1rwjliJrXauaksRJVSaQ=; b=AoDgRIDDeLO9g54eWE/zNS0YS6mCN9PwF2GXCtPK+C8MmySuJKZCquOgw/wmOBx5qb lVQ/314+K+iYHMAUGly6HQXK36zUGvP8j6bdTBZzgu+XTKWuC74KqDCCKc8Dz2gIfWPh V/xlF7L4aCgEUktxTPfJcWah5vwD1ifRC7bBy8PVcc5W5Tf2NX6d3xdMySWq2h1/LbzZ SdOnDcMG/oNDGcgKZpdyUSaI2SGEFxFoLuTJ5alsXr0p1wc+zT9xKzzhcnGa1jeoAaVl m161A7He7SMb+HoYgkEiIa76pN3VhMpnwJcBQGeJhEj+hn0+rTy8bBoDTk75XpiqEyWA yCYQ== X-Received: by 10.112.126.136 with SMTP id my8mr13727187lbb.18.1429501090529; Sun, 19 Apr 2015 20:38:10 -0700 (PDT) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id j1sm4028633lbc.15.2015.04.19.20.38.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Apr 2015 20:38:09 -0700 (PDT) Date: Mon, 20 Apr 2015 06:38:06 +0300 From: Andrei Borzenkov To: Michael Chang Subject: Re: [PATCH 1/3] Added net_bootp6 command Message-ID: <20150420063806.2d031181@opensuse.site> In-Reply-To: <20150420030910.GA18433@linux-dsax.tai.apac.novell.com> References: <1429088709-924-1-git-send-email-mchang@suse.com> <1429088709-924-2-git-send-email-mchang@suse.com> <20150416174056.020fd96d@opensuse.site> <20150417050427.GA8017@linux-dsax.tai.apac.novell.com> <20150419111521.039880c4@opensuse.site> <20150420030910.GA18433@linux-dsax.tai.apac.novell.com> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.27; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::236 Cc: grub-devel@gnu.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2015 03:38:18 -0000 =D0=92 Mon, 20 Apr 2015 11:09:10 +0800 Michael Chang =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 > >=20 > > > > > + > > > > > + ip_start =3D ip_end =3D NULL; > > > > > + ip_start =3D bootfile_url + grub_strlen(pr); > > > > > + > > > > > + if (*ip_start !=3D '[') > > > > > + ip_start =3D NULL; > > > > > + else > > > > > + ip_end =3D grub_strchr (++ip_start, ']'); > > > > > + > > > > > + if (!ip_start || !ip_end) > > > > > + { > > > > > + grub_error (GRUB_ERR_IO, N_("IPv6-address not in square br= ackets")); > > > > > + goto cleanup; > > > > > + } > > > > > + > > > >=20 > > > > Can bootfile_url contain a name and not IPv6 address? Or is address > > > > mandatory? > > >=20 > > > Yes. The string in URL form is mandatory. > > > > >=20 > > I probably was not clear. Must it always be IPv6 address literal as > > implied by code or can it be e.g. DNS name? >=20 > The DNS name could be legit for URL, but current elilo and edk2 > explicitly checks for the starting and ending delimiter '[..]' for using > the server address and any name is treated as invalid parameters. The > implementation just followed them. >=20 OK, could you put in comments here which explain it, probably marked as TODO. > >=20 > > Yes, but what I mean - this function is only called when we already > > checked for message_type =3D=3D DHCPv6_REPLY. So the only reason it can= be > > different here is physical memory corruption. >=20 > It also gets called from grub_efi_net_config_real () which doesn't have > any check for message type. >=20 So you do not trust firmware, do you? :) But OK, let's leave check in place. P.S. grub_efi_net_config_real should actually have checked DhcpAckReceived to start with, but I'm afraid to add it now, at least until we have real report of invalid packages.