rhboot / rhboot/shim

Rework replacements.c and load_image()/start_image()

Open
#431 0 comments 0 reactions 1 assignee View on GitHub

@vathpela is already working on this.

Since Nov 3, 2021.

Dominant language
C
Stars
1.1k
Forks
348
PR merge metrics
No merged PRs in 30d

Description

The gist here is that shim's load_image()/start_image() and verification protocol could be much more straightforward:

  1. when shim starts, it should replace BS->LoadImage(), BS->StartImage(), BS->Exit(), and BS->ExitBootServices() with its own, like replacements.c does now
  2. the replacement should transparently enforce the verification protocol
  3. load_image() should install a handle on each EFI_LOADED_IMAGE it returns to identify that it was created by this particular instance
  4. the handle guid should be generated at runtime using a SHA2 digest of some load address, so that stacked invocations are separate
  5. start_image() should look for the handle, and if it's not there (meaning this EFI_LOADED_IMAGE was not created by this instance of shim's load_image()), defer to the start_image() implementation it replaced at startup
  6. shim also needs to register a protocol with a well known GUID that has these functions in it, so that a nested shim invocation can defer to using them safely rather than installing its own.
  7. it may be useful to also implement a UEFI volatile keys protocol, so consumers can register their own trust anchors during the boot sequence.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.