From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CDC9E8211E for ; Thu, 23 Feb 2017 23:40:14 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2017 23:40:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,200,1484035200"; d="scan'208";a="69640979" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 23 Feb 2017 23:40:14 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 23 Feb 2017 23:40:14 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Fri, 24 Feb 2017 15:40:10 +0800 From: "Tian, Feng" To: Andrei Borzenkov , edk2-devel-01 , The development of GNU GRUB CC: "Tian, Feng" Thread-Topic: [edk2] Should Path Name in File Path Media Device Path node be NULL terminated? Thread-Index: AQHSjmyL9KlRZ5+P7kqEfxlvbSfhkqF3xUmg Date: Fri, 24 Feb 2017 07:40:09 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699B5245@SHSMSX101.ccr.corp.intel.com> References: <4f2ae7ff-9e79-8fd7-5a09-0841e3f21d0c@gmail.com> In-Reply-To: <4f2ae7ff-9e79-8fd7-5a09-0841e3f21d0c@gmail.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: Should Path Name in File Path Media Device Path node be NULL terminated? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 07:40:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable UEFI spec clearly say: "Path Name" is A NULL-terminated Path string including directory and file n= ames. The length of this string n can be determined by subtracting 4 from the Length entry. A device path may contain one or more = of these nodes. Each node can optionally add a "\" separator to the beginni= ng and/or the end of the Path Name string. The complete path to a file can = be found by logically concatenating all the Path Name strings in the File P= ath Media Device Path nodes. This is typically used to describe the directo= ry path in one node, and the filename in another node. Thanks Feng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Andr= ei Borzenkov Sent: Friday, February 24, 2017 3:06 PM To: edk2-devel-01 ; The development of GNU GRUB Subject: [edk2] Should Path Name in File Path Media Device Path node be NUL= L terminated? Historically grub2 built image paths using two File Path nodes - one for di= rectory and one for file name relative to directory. These nodes had path n= ames that were not NULL terminated. Recently we had bug report that secure boot using grub2 failed. It was trac= ked down to exactly the fact that paths were not NULL terminated. See http://git.savannah.gnu.org/cgit/grub.git/commit/?id=3Dce95549cc54b5d6f4946= 08a7c390dba3aab4fba7 Unfortunately this caused another regression which looks like firmware trun= cating passed image path on first NULL https://bugzilla.opensuse.org/show_bug.cgi?id=3D1026344 Could someone clarify what is expected by EFI spec? Should each Path Name (= even intermediate) be NULL terminated, or spec intends to say that only ful= l path must be NULL terminated? _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel