Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XmkOh-0006s9-3N for mharc-grub-devel@gnu.org; Fri, 07 Nov 2014 09:20:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmkOZ-0006pb-Jt for grub-devel@gnu.org; Fri, 07 Nov 2014 09:20:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmkOT-00034A-GS for grub-devel@gnu.org; Fri, 07 Nov 2014 09:20:11 -0500 Received: from mail-wi0-f171.google.com ([209.85.212.171]:50547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmkOT-0002wu-BT for grub-devel@gnu.org; Fri, 07 Nov 2014 09:20:05 -0500 Received: by mail-wi0-f171.google.com with SMTP id r20so4691836wiv.16 for ; Fri, 07 Nov 2014 06:20:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=S6z3Kfu6e/CMoy8fZ0YQ08coeWvJ+ENPDvTS5KR4jsY=; b=MwQDKIwj1XPBtt1ei2TnxGHvJ28J0yxgwOkxtPOb8K5MQdLm8Ji2XJCrUgEenx5w6G 9jGmS11jvrIn1XFY2hhTs22kxW43Gepp2Tcl7XUmaz9PXV9TJw4KheMADRD610vpaXzE OFV6Vq8NhG8xBdYCRZb2Hu+ZsUfevcjAMr8FeXg+nxUdUhVzphhXyJISfDEMx53UDGyu tIiUf4i7NOm3WZ8qujJoTeHAzmFU28Vb6iHBcoFquDlNmZNzlWayhS3yrapD1cTUDFe5 WcYj4M0p3j8silO1QFVhjXv85UMiSzcUDqTj2teS2GDPODqKxr9NH1FqPXCyvAhl06Yw xvzQ== X-Gm-Message-State: ALoCoQm69D2GWEdGqikjoYoeQSilN6cNfor764t5PTKl/R18q7Hp0uAOG0SwGFgPx1oGGdPiqPK7 X-Received: by 10.180.91.70 with SMTP id cc6mr5663915wib.5.1415370002353; Fri, 07 Nov 2014 06:20:02 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by mx.google.com with ESMTPSA id u8sm12001352wjq.1.2014.11.07.06.20.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 07 Nov 2014 06:20:01 -0800 (PST) Date: Fri, 7 Nov 2014 14:19:58 +0000 From: Leif Lindholm To: The development of GNU GRUB Subject: Re: [PATCH] efi: check *path non-null before grub_strrchr Message-ID: <20141107141958.GG22224@bivouac.eciton.net> References: <20141105125331.GB22224@bivouac.eciton.net> <20141105145232.GE22224@bivouac.eciton.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.171 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: Fri, 07 Nov 2014 14:20:16 -0000 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 image > >> > 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_strrchr > >> > to do this, and neither does grub_strrchr before dereferencing a NULL > >> > 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. > > > > 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. Indeed, but with this patch you would at least get a confused error message later on. > You have commit access, right? Yes - clear to push? / Leif