<feed xmlns='http://www.w3.org/2005/Atom'>
<title>efi-boot-shim.git/replacements.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-11T15:43:37+00:00</updated>
<entry>
<title>Move some stuff around</title>
<updated>2025-02-11T15:43:37+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2023-06-30T17:24:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=e7b3598311c4b002417ac6364093cfab218ced88'/>
<id>urn:sha1:e7b3598311c4b002417ac6364093cfab218ced88</id>
<content type='text'>
This moves some things around to help with loader protocol changes:

- Move replacements.c to loader-proto.c
- likewise with replacements.h
- move the SHIM_IMAGE_LOADER decl to loader-proto.h
- move the LoadImage / StartImage interface setup to an init function
- move shim_load_image() / shim_start_image() to loader-proto.c

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>Implement shim image load protocol</title>
<updated>2025-02-11T15:43:37+00:00</updated>
<author>
<name>Ard Biesheuvel</name>
<email>ardb@kernel.org</email>
</author>
<published>2023-06-29T15:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=bb114a3b92a96875dc71e5e4925bedba5c02f958'/>
<id>urn:sha1:bb114a3b92a96875dc71e5e4925bedba5c02f958</id>
<content type='text'>
Define a new protocol for loading and starting images, encapsulating
shim's PE loading facilities and verification/authentication against the
same set of certificates that shim_lock::verify() authenticates against.

This removes the need for loaders like GRUB to implement their own PE
loader in order to be able to invoke loaded images as PE applications,
rather than implementing a bespoke OS dependent handover protocol (e.g.,
invoke Linux via its EFI stub)

Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>Rename 'msecs' to 'usecs' to avoid potential confusion</title>
<updated>2023-06-21T18:19:51+00:00</updated>
<author>
<name>Kamil Aronowski</name>
<email>kamil.aronowski@yahoo.com</email>
</author>
<published>2023-04-12T16:50:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=549d34691d68518e55c2edd6e759b19de7f8ddef'/>
<id>urn:sha1:549d34691d68518e55c2edd6e759b19de7f8ddef</id>
<content type='text'>
The function msleep uses gBS-&gt;Stall which waits for a specified number
of microseconds.

Reference: https://edk2-docs.gitbook.io/edk-ii-uefi-driver-writer-s-guide/5_uefi_services/51_services_that_uefi_drivers_commonly_use/517_stall

This reference even mentions an example sleeping for 10 microseconds: // Wait 10 uS. Notice the letter 'u'.

Therefore it's a good idea to call the function 'usleep' rather than
'msleep', so no one confuses it with milliseconds, and to change the
argument name to match as well.

Signed-off-by: Kamil Aronowski &lt;kamil.aronowski@yahoo.com&gt;
</content>
</entry>
<entry>
<title>Optionally allow to keep shim protocol installed</title>
<updated>2023-05-02T17:53:08+00:00</updated>
<author>
<name>Luca Boccassi</name>
<email>bluca@debian.org</email>
</author>
<published>2023-04-22T18:53:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=1f38cb30a5e1dcea97b8d48915515b866ec13c32'/>
<id>urn:sha1:1f38cb30a5e1dcea97b8d48915515b866ec13c32</id>
<content type='text'>
If the ShimRetainProtocol variable is set, avoid uninstalling our
protocol.
For example, this allows sd-stub in a UKI to use the shim protocol to
validate PE binaries, even if it is executed by a second stage, before
the kernel is loaded.
Ensure that the variable is volatile and for BootServices access.
Also delete it on startup, so that we can be sure it was really set by
a second stage.

Example use case in sd-boot/sd-stub:

https://github.com/systemd/systemd/pull/27358

Signed-off-by: Luca Boccassi &lt;bluca@debian.org&gt;
</content>
</entry>
<entry>
<title>cleanup: always use BS and RT, not gBS and gRT</title>
<updated>2021-09-07T21:05:04+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-07-23T18:28:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=6ea93a28759d754778e483f86f95587a01c5fee8'/>
<id>urn:sha1:6ea93a28759d754778e483f86f95587a01c5fee8</id>
<content type='text'>
This just makes one less thing we have to make sure is the same between
the test harnesses and the runtime code.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>Don't unhook ExitBootServices() when EBS protection is disabled</title>
<updated>2021-07-20T14:17:02+00:00</updated>
<author>
<name>Seth Forshee</name>
<email>seth.forshee@canonical.com</email>
</author>
<published>2021-06-05T12:34:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=4583db41ea58195956d4cdf97c43a195939f906b'/>
<id>urn:sha1:4583db41ea58195956d4cdf97c43a195939f906b</id>
<content type='text'>
When EBS protection is disabled the code which hooks into EBS is
complied out, but on unhook it's the code which restores Exit() that
is disabled. This appears to be a mistake, and it can result in
writing NULL to EBS in the boot services table.

Fix this by moving the ifdefs to compile out the code to unhook EBS
instead of the code to unhook Exit(). Also ifdef the definition of
system_exit_boot_services to safeguard against its accidental use.

Fixes: 4b0a61dc9a95 ("shim: compile time option to bypass the ExitBootServices() check")
Signed-off-by: Seth Forshee &lt;seth.forshee@canonical.com&gt;
</content>
</entry>
<entry>
<title>Restructure our includes.</title>
<updated>2021-03-10T20:54:20+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2021-03-09T16:42:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=f033a1da9f4c3acf7e3dfef906d01e348b6fcf42'/>
<id>urn:sha1:f033a1da9f4c3acf7e3dfef906d01e348b6fcf42</id>
<content type='text'>
This re-structures our includes so we can be sure everything is always
including all the system headers in a uniform, predictable way.

Temporarily it also adds a bunch of junk at all the places we use
variadic functions to specifically pick either the MS (cdecl) or ELF
ABIs.

I'm not 100% sure that's all correct (see later patch) but it's enough
to allow this to build.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>Restore loaded image of shim at Exit()</title>
<updated>2021-03-07T00:02:58+00:00</updated>
<author>
<name>Gary Lin</name>
<email>glin@suse.com</email>
</author>
<published>2021-03-05T07:00:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=74d26654d55a4f32e58b76757efca50ceedefef4'/>
<id>urn:sha1:74d26654d55a4f32e58b76757efca50ceedefef4</id>
<content type='text'>
When grub2 invoked Exit() in AArch64 AAVMF, the VM crashed with the
following messsages:

Unloading driver at 0x000B7D7B000

Synchronous Exception at 0x00000000BF5D5E68
AllocatePool: failed to allocate 800 bytes

Synchronous Exception at 0x00000000BF5D5E68

The similar error also showed when I modified MokManager to call
gBS-&gt;Exit() at the end of efi_main(). However, if MokManager just
returned, the error never showed. One significant difference is
whether the loaded image was restored or not, and the firmware seems
to need the original ImageBase pointer to do clean-up.

To avoid the potential crash, this commit adds restore_loaded_image() so
that we can restore the loaded image both in start_image() and
do_exit().

Signed-off-by: Gary Lin &lt;glin@suse.com&gt;
</content>
</entry>
<entry>
<title>Fix up a bunch of our license statements and add SPDX most places</title>
<updated>2021-02-16T08:12:48+00:00</updated>
<author>
<name>Peter Jones</name>
<email>pjones@redhat.com</email>
</author>
<published>2020-12-11T20:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=aedb8470bd673385139ac3189ecd9edf4794af16'/>
<id>urn:sha1:aedb8470bd673385139ac3189ecd9edf4794af16</id>
<content type='text'>
The license statements in our source files were getting to be a giant
mess, and mostly they all just say the same thing.  I've switched most
of it to SPDX labels, but left copyright statements in place (where they
were not obviously incorrect copy-paste jobs that I did...).

If there's some change here you don't think is valid, let me know and
we can fix it up together.

Signed-off-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>shim: compile time option to bypass the ExitBootServices() check</title>
<updated>2021-01-29T20:53:34+00:00</updated>
<author>
<name>Paul Moore</name>
<email>pmoore2@cisco.com</email>
</author>
<published>2020-10-29T13:49:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/efi-boot-shim.git/commit/?id=4b0a61dc9a952028c7b1ccc8914835d989ce661e'/>
<id>urn:sha1:4b0a61dc9a952028c7b1ccc8914835d989ce661e</id>
<content type='text'>
On systems where a second stage bootloader is not used, and the Linux
Kernel is booted directly from shim, shim's ExitBootServices() hook
can cause problems as the kernel never calls the shim's verification
protocol.  In this case calling the shim verification protocol is
unnecessary and redundant as shim has already verified the kernel
when shim loaded the kernel as the second stage loader.

This functionality is disabled by default and must be enabled via the
DISABLE_EBS_PROTECTION macro/define at build time.

Signed-off-by: Paul Moore &lt;pmoore2@cisco.com&gt;
</content>
</entry>
</feed>
