From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XpgiM-0000td-7Q for mharc-grub-devel@gnu.org; Sat, 15 Nov 2014 12:00:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpgiG-0000ol-Om for grub-devel@gnu.org; Sat, 15 Nov 2014 12:00:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpgiB-0005OG-RE for grub-devel@gnu.org; Sat, 15 Nov 2014 12:00:40 -0500 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:63213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpgiB-0005O5-A6 for grub-devel@gnu.org; Sat, 15 Nov 2014 12:00:35 -0500 Received: by mail-lb0-f177.google.com with SMTP id z12so7329034lbi.22 for ; Sat, 15 Nov 2014 09:00:34 -0800 (PST) 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=Muf4v7kIx3ajLSSpCEQy324VJEyIcdNMcxkylqpnqRg=; b=0MIKKY3MCqjjPfAASm2libxpB67fkEKE0AkgFDU512Kf6kvNhLWp03ZJAwPJDodmKZ XqFB6gsHAsQ3fX+rMv+YJ9undh/N46WXhTAa3CTXkGpoqgLQlMnq4vp0zE7tlIeDaC0A aTCugfcp3e/Fj3YcHvvG54LWBx00Iw+pchVswV9J5Wt3UPas7fufGcbgsbMyWLzKCfls GVkOYtFaerzvtJyLbw48yi5AS6z89oTB7Rmci4RqaQs8MTjSPZ8ZoZCMLEFTfSUz3mNn XxMmOC8XGzYUE/IyXixOeevF1e1LRDI18wGOx1XxJfMA3jq+IHJWiRNcpSP49NeX/4Zc qHcA== X-Received: by 10.112.166.101 with SMTP id zf5mr15246014lbb.42.1416070834027; Sat, 15 Nov 2014 09:00:34 -0800 (PST) Received: from opensuse.site (ppp91-76-139-38.pppoe.mtu-net.ru. [91.76.139.38]) by mx.google.com with ESMTPSA id of1sm9058868lbb.3.2014.11.15.09.00.32 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Nov 2014 09:00:33 -0800 (PST) Date: Sat, 15 Nov 2014 20:00:32 +0300 From: Andrei Borzenkov To: Leif Lindholm Subject: Re: [PATCH] efi: check *path non-null before grub_strrchr Message-ID: <20141115200032.784f9543@opensuse.site> In-Reply-To: <20141107141958.GG22224@bivouac.eciton.net> References: <20141105125331.GB22224@bivouac.eciton.net> <20141105145232.GE22224@bivouac.eciton.net> <20141107141958.GG22224@bivouac.eciton.net> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; 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::231 Cc: The development of GNU GRUB 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: Sat, 15 Nov 2014 17:00:45 -0000 =D0=92 Fri, 7 Nov 2014 14:19:58 +0000 Leif Lindholm =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > On Wed, Nov 05, 2014 at 06:19:16PM +0300, Andrei Borzenkov wrote: > > On Wed, Nov 5, 2014 at 5:52 PM, Leif Lindholm wrote: > > > On Wed, Nov 05, 2014 at 05:33:40PM +0300, Andrei Borzenkov wrote: > > >> On Wed, Nov 5, 2014 at 3:53 PM, Leif Lindholm wrote: > > >> > The EFI version of grub_machine_get_bootlocation crops the boot im= age > > >> > name back to the last / in order to get a directory path. However,= it > > >> > does not check that *name is actually set before calling grub_strr= chr > > >> > to do this, and neither does grub_strrchr before dereferencing a N= ULL > > >> > pointer. > > >> > > > >> > > >> I wonder - do you actually have firmware that returns empty path? > > > > > > I did (internal development version), and that's being fixed that end > > > too, but more graceful error handling in GRUB would still be nice. > > > > >=20 > > Sure. I wish we could display some meaningful warning here, but it is > > too early at this stage. If get_loaded_image fails to return proper > > image path, booting is probably screwed anyway. >=20 > Indeed, but with this patch you would at least get a confused error > message later on. > =20 > > You have commit access, right? >=20 > Yes - clear to push? >=20 Yes. It is clear bug fix. > / > Leif >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel