public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Should Path Name in File Path Media Device Path node be NULL terminated?
@ 2017-02-24  7:06 Andrei Borzenkov
  2017-02-24  7:40 ` Tian, Feng
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Borzenkov @ 2017-02-24  7:06 UTC (permalink / raw)
  To: edk2-devel-01, The development of GNU GRUB

Historically grub2 built image paths using two File Path nodes - one for
directory and one for file name relative to directory. These nodes had
path names that were not NULL terminated.

Recently we had bug report that secure boot using grub2 failed. It was
tracked down to exactly the fact that paths were not NULL terminated.
See
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=ce95549cc54b5d6f494608a7c390dba3aab4fba7

Unfortunately this caused another regression which looks like firmware
truncating passed image path on first NULL

https://bugzilla.opensuse.org/show_bug.cgi?id=1026344

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 full path must be NULL terminated?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Should Path Name in File Path Media Device Path node be NULL terminated?
  2017-02-24  7:06 Should Path Name in File Path Media Device Path node be NULL terminated? Andrei Borzenkov
@ 2017-02-24  7:40 ` Tian, Feng
  0 siblings, 0 replies; 2+ messages in thread
From: Tian, Feng @ 2017-02-24  7:40 UTC (permalink / raw)
  To: Andrei Borzenkov, edk2-devel-01, The development of GNU GRUB; +Cc: Tian, Feng

UEFI spec clearly say:

"Path Name" is A NULL-terminated Path string including directory and file names. 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 beginning 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 Path Media Device Path nodes. This is typically used to describe the directory 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 Andrei Borzenkov
Sent: Friday, February 24, 2017 3:06 PM
To: edk2-devel-01 <edk2-devel@ml01.01.org>; The development of GNU GRUB <grub-devel@gnu.org>
Subject: [edk2] Should Path Name in File Path Media Device Path node be NULL terminated?

Historically grub2 built image paths using two File Path nodes - one for directory and one for file name relative to directory. These nodes had path names that were not NULL terminated.

Recently we had bug report that secure boot using grub2 failed. It was tracked down to exactly the fact that paths were not NULL terminated.
See
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=ce95549cc54b5d6f494608a7c390dba3aab4fba7

Unfortunately this caused another regression which looks like firmware truncating passed image path on first NULL

https://bugzilla.opensuse.org/show_bug.cgi?id=1026344

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 full path must be NULL terminated?
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-24  7:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24  7:06 Should Path Name in File Path Media Device Path node be NULL terminated? Andrei Borzenkov
2017-02-24  7:40 ` Tian, Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox