Received: from list by lists.gnu.org with archive (Exim 4.71) id 1chVAB-00028K-QX for mharc-grub-devel@gnu.org; Sat, 25 Feb 2017 00:44:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chVA9-000276-PR for grub-devel@gnu.org; Sat, 25 Feb 2017 00:44:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chVA6-0001rW-Nz for grub-devel@gnu.org; Sat, 25 Feb 2017 00:44:57 -0500 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:36283) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chVA6-0001oA-Fy for grub-devel@gnu.org; Sat, 25 Feb 2017 00:44:54 -0500 Received: by mail-lf0-x230.google.com with SMTP id b80so16275809lfe.3 for ; Fri, 24 Feb 2017 21:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=aBdEN9d+TwTWlcd5/5CUXflcDeUkwQJP6gbeHtX2Aw0=; b=JvOJ7NIq9gaZekKf0D05b1JeYvYC506taJ6m6Fi+J6a/RBMzug4eK1+8YBu8pZtLBc 1gFXLHmYbojAkDU6oTgB/gTYA21d3kLNNoAZ050F57QccyWrwO1PVkf4YLIVDomUsxbI gVsVQpjEjybOEsMu5dVXVPqWTw5qHLZlFhGiUMn2ApWu0d8QNULXyMgQy1xeId6XxvqU UOKvn4Y/vBPBiasuIB+fvFohyW/E+xIGhg5wTzRD/jaA+h+4b4clAmEDFAPa0PCDTba+ GtzsTsEHuVQJyNUia2kP3e3nRZHFSL4Ckc3pWrOYeGO37SQzaqgB79PZ69KZ2Hh41OY9 QQNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=aBdEN9d+TwTWlcd5/5CUXflcDeUkwQJP6gbeHtX2Aw0=; b=roLeBDeaOTXFqegdh63j5qK+EKLOy8wAOROLadpJJh8qt0zIldGQiPb8kagQF/6sr6 JmM2fGyJGQwhtzeHOhPMKAn/emh7bft0i9+dMDqHXIXufBSsTD3kvHw8+lW94hUHSsTz iF6KNyZvaBD4V1EItiDZhp0nhVgWV9DO6VrFT4lWHVyKICqJG2D/wv/OuOPlAsUM/ZCd lVloK/OxdGjsryGuujMSk9xg/P2lDg4TQZa0GeK5LxfSI8BGTwMxSoASIpCZJ/OXHU/K uVsF9cfgnvMEtD7hlBjXXBeHwJGSxaBheD6YF+YqJueaNzHSveLExzR820DbP8fLpxKV xKYA== X-Gm-Message-State: AMke39mI8JrFw6wZblHor7azx7QEt0rgoHapjeZ/S28Gxp55LwgWdYTNbpsO0Ste1hMFyQ== X-Received: by 10.25.15.198 with SMTP id 67mr1599297lfp.53.1488001489507; Fri, 24 Feb 2017 21:44:49 -0800 (PST) Received: from [192.168.1.6] (ppp109-252-90-129.pppoe.spdop.ru. [109.252.90.129]) by smtp.gmail.com with ESMTPSA id c76sm620428ljd.44.2017.02.24.21.44.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 21:44:48 -0800 (PST) Subject: Re: [PATCH] efi: strip off final NULL from File Path in grub_efi_get_filename To: The development of GNU GRUB References: <1487919270-26971-1-git-send-email-arvidjaar@gmail.com> <1487925820-32432-1-git-send-email-arvidjaar@gmail.com> Cc: mchang@suse.com From: Andrei Borzenkov Message-ID: Date: Sat, 25 Feb 2017 08:44:47 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::230 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: Sat, 25 Feb 2017 05:44:59 -0000 25.02.2017 02:21, Vladimir 'phcoder' Serbinenko пишет: > On Fri, Feb 24, 2017, 09:47 Andrei Borzenkov wrote: > >> UEFI 2.6 9.3.6.4 File Path Media Device Path says that Path Name is >> "A NULL-terminated Path string including directory and file names". >> >> Strip final NULL from Path Name in each File Path node when constructing >> full path. To be on safe side, strip all of them. >> >> Fixes failure chainloading grub from grub, when loaded grub truncates >> image path and does not find its grub.cfg. >> >> https://bugzilla.opensuse.org/show_bug.cgi?id=1026344 >> >> This was triggered by commit ce95549cc54b5d6f494608a7c390dba3aab4fba7; >> before it we built Path Name without trailing NULL, and apparently all >> other bootloaders use single File Path node, thus not exposing this bug. >> >> --- >> @Vladimir, @Daniel - this fixes regression in rc1 and is real fix for >> the mentioned problem (previous patch only fixed the case of grub - grub >> chainloading, this patch should properly parse image path also when called >> from other EFI application). >> > I'm OK with this patch. Especially that it's unlikely to break anything. Is Committed. > the other patch still needed? If other loaders do it with a single path > element we should probably too, to avoid this kind of bugs. Question is > mostly whether it's rc1 material. > It is not needed. I would still consider it long term - it makes code less confusing and avoids probably less-utilized code paths elsewhere. It also demonstrates that we desperately need EFI boot tests. Much thanks to SUSE for setting up comprehensive test suite!