<feed xmlns='http://www.w3.org/2005/Atom'>
<title>efi-boot-shim.git/load-options.c, branch rolling</title>
<subtitle> (mirror of https://github.com/vyos/efi-boot-shim.git)
</subtitle>
<id>https://git.amelek.net/vyos/efi-boot-shim.git/atom?h=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/efi-boot-shim.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/'/>
<updated>2025-02-24T20:22:28+00:00</updated>
<entry>
<title>Silence minor nit in load-options parsing debug output</title>
<updated>2025-02-24T20:22:28+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2025-02-19T18:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=e3f0338b53e2926f910aebc420ae2faa13e8b0fd'/>
<id>urn:sha1:e3f0338b53e2926f910aebc420ae2faa13e8b0fd</id>
<content type='text'>
Previously when there were no load options, this would go in the debug
log:

  load-options.c:313:parse_load_options() full load options:
  include/hexdump.h:92:vhexdumpf() hexdump of a NULL pointer!

This changes it to say:

  load-options.c:315:parse_load_options() LoadOptions is empty

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>Add configuration option to boot an alternative 2nd stage</title>
<updated>2025-02-06T20:13:23+00:00</updated>
<author>
<name>Eric Snowberg</name>
<email>eric.snowberg@oracle.com</email>
</author>
<published>2023-08-29T21:25:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=83850cd8df2db60a00b96e7757c6ff9c1d8cccec'/>
<id>urn:sha1:83850cd8df2db60a00b96e7757c6ff9c1d8cccec</id>
<content type='text'>
Add the ability for shim to load an optional configuration file.  This
new file is called "options.csv".  The configuration file is completely
optional. If used, it is located in the same directory as the booted
shim.  The "options.csv" file currently allows a single entry.  Other
options could be added to it in the future.  The first and only entry in
the file is the name of the secondary boot loader shim will load. The
"options.csv" file is in Unicode LE format.

This allows a signed shim to directly load a UKI without the need to
rename it to grub. Shim's transitive trust is maintained. If the
alternative 2nd stage can not be verified, it will not boot.

Signed-off-by: Eric Snowberg &lt;eric.snowberg@oracle.com&gt;
</content>
</entry>
<entry>
<title>shim: Allow data after the end of device path node in load options</title>
<updated>2025-01-15T20:59:30+00:00</updated>
<author>
<name>Dan Nicholson</name>
<email>dbn@endlessos.org</email>
</author>
<published>2024-10-02T22:51:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=d8c86b740667544acccad92c06eddbc858808a74'/>
<id>urn:sha1:d8c86b740667544acccad92c06eddbc858808a74</id>
<content type='text'>
When looking for load option optional data, the parser asserts that the
byte after the end of device path node is the same as what the file path
length says it should be. While unusual, it is valid if the end of
device path node comes before the end of the file path list.

That supports some unusual Dell load options where there are two device
paths in the list but the first is terminated by an End Entire Device
Path. Maybe they intended to use an End Device Path Instance node there?
Who knows. Either way, treating it as invalid ends up trying to read
paths from the beginning of the option with obviously poor results.

Fixes: #649

Signed-off-by: Dan Nicholson &lt;dbn@endlessos.org&gt;
</content>
</entry>
<entry>
<title>Discard load-options that start with WINDOWS</title>
<updated>2024-12-17T19:35:26+00:00</updated>
<author>
<name>Lauri Kenttä</name>
<email>lauri.kentta@gmail.com</email>
</author>
<published>2023-12-02T18:27:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=314aecf89318d31697a3fabf14cf49a0dc359331'/>
<id>urn:sha1:314aecf89318d31697a3fabf14cf49a0dc359331</id>
<content type='text'>
Windows bcdedit.exe creates boot entries where load options
begin with "WINDOWS\0" (in 8-bit chars), followed by some
Windows-specific data which is useless for shim. This data
causes shim error "Failed to open \EFI\mypath\䥗䑎坏S".

Resolves: #370
Signed-off-by: Lauri Kenttä &lt;lauri.kentta@gmail.com&gt;
</content>
</entry>
<entry>
<title>shim: don't set second_stage to the empty string</title>
<updated>2024-05-08T21:01:58+00:00</updated>
<author>
<name>Jonathan Davies</name>
<email>jonathan.davies@nutanix.com</email>
</author>
<published>2024-02-22T16:24:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=0287c6b14c77eeb3e3c61996330850d43d937a2b'/>
<id>urn:sha1:0287c6b14c77eeb3e3c61996330850d43d937a2b</id>
<content type='text'>
When LoadOptions is either L" " or L"shim.efi ", parse_load_options sets
second_stage to the empty string. This is unlikely to be what is intended, and
typically leads to a non-obvious failure mode.

The failure happens because parse_load_options's call to split_load_options
(after eating shim's own filename, if present) returns the empty string. Since
init_grub typically passes second_stage to start_image, this causes read_image
to concatenate the empty string onto the directory name. This means PathName
refers to the directory, not the path to a pe image. Then load_image
successfully opens a handle on the directory and reads "data" from it. It only
eventually fails when handle_image calls read_header which finds that this data
isn't in fact a pe header, reporting "Invalid image".

This scenario has been seen when shim is loaded via rEFInd 0.11.5, which sets
LoadOptions to the name of the shim program followed by a space character.

Instead, modify parse_load_options to leave second_stage set to its default
value rather than the empty string.

Signed-off-by: Jonathan Davies &lt;jonathan.davies@nutanix.com&gt;
</content>
</entry>
<entry>
<title>Discard load-options that start with a NUL</title>
<updated>2022-09-01T19:38:02+00:00</updated>
<author>
<name>Robbie Harwood</name>
<email>rharwood@redhat.com</email>
</author>
<published>2022-08-23T16:07:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=14d63398298c8de23036a4cf61594108b7345863'/>
<id>urn:sha1:14d63398298c8de23036a4cf61594108b7345863</id>
<content type='text'>
In 6c8d08c0af4768c715b79c8ec25141d56e34f8b4 ("shim: Ignore UEFI
LoadOptions that are just NUL characters."), a check was added to
discard load options that are entirely NUL.  We now see some firmwares
that start LoadOptions with a NUL, and then follow it with garbage (path
to directory containing loaders).  Widen the check to just discard
anything that starts with a NUL.

Resolves: #490
Related: #95
See-also: https://bugzilla.redhat.com/show_bug.cgi?id=2113005
Signed-off-by: Robbie Harwood &lt;rharwood@redhat.com&gt;
</content>
</entry>
<entry>
<title>shim: Dump load options in verbose mode</title>
<updated>2021-09-14T15:19:58+00:00</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2021-07-30T10:48:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=e54e5858844242d2900a036af07cef9e3bff8d02'/>
<id>urn:sha1:e54e5858844242d2900a036af07cef9e3bff8d02</id>
<content type='text'>
Dump the load options before parsing them so that we can
see which things are failing to parse.
</content>
</entry>
<entry>
<title>shim: don't fail on the odd LoadOptions length</title>
<updated>2021-07-20T13:44:47+00:00</updated>
<author>
<name>Gary Lin</name>
<email>glin@suse.com</email>
</author>
<published>2021-06-04T09:02:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=ada7ff69bd8a95614aa63dd618764daf428f235d'/>
<id>urn:sha1:ada7ff69bd8a95614aa63dd618764daf428f235d</id>
<content type='text'>
Some firmware feeds the LoadOptions with an odd length when booting from
an USB device(*). We should only skip this kind of LoadOptions, not fail
it, or the user won't be able to boot the system from USB or CD-ROM.

(*) https://bugzilla.suse.com/show_bug.cgi?id=1185232#c62

Signed-off-by: Gary Lin &lt;glin@suse.com&gt;
</content>
</entry>
<entry>
<title>Add a tester for parse_load_options()</title>
<updated>2021-07-20T13:44:25+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-07-02T18:36:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=3ea1f37c70c571537c92e2be0d78a1ad4629af8f'/>
<id>urn:sha1:3ea1f37c70c571537c92e2be0d78a1ad4629af8f</id>
<content type='text'>
This adds tests for all the cases we've documented in the
set_second_stage() comments.  Each test checks that all of second_stage,
loader_str, and loader_str_size are set correctly.

Note that this adds a dependency on libefivar to build device paths to
test against.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>shim: move the bulk of set_second_stage() to its own file</title>
<updated>2021-07-20T13:44:25+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-07-02T18:22:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=9e4f38abe61b600826360c14729cc54ea3ec7c3c'/>
<id>urn:sha1:9e4f38abe61b600826360c14729cc54ea3ec7c3c</id>
<content type='text'>
This moves set_second_stage() and some of the helper functions it uses
out of shim.c, so that it's easier to write test cases for.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
</feed>
