Skip to content

Mirror some more efi variables to mok-variables#723

Merged
vathpela merged 4 commits intorhboot:mainfrom
vathpela:mirror-more-stuff
Feb 24, 2025
Merged

Mirror some more efi variables to mok-variables#723
vathpela merged 4 commits intorhboot:mainfrom
vathpela:mirror-more-stuff

Conversation

@vathpela
Copy link
Member

Some machines have EFI Boot Services variables but not Runtime variables, and thus it can be quite difficult to figure out what's going on once the system is booted.

This changes mok variable mirroring to also mirror the following variables to the mok variable config table:

  AuditMode
  BootOrder
  BootCurrent
  BootNext
  Boot0000
  Boot0001
  Boot0002
  Boot0003
  Boot0004
  Boot0005
  Boot0006
  DeployedMode
  SecureBoot
  SetupMode
  SignatureSupport
  PK
  KEK
  db
  dbx
  Kernel_SkuSiStatus

There's no attempt to do anything involving creating runtime or boot-services only variables, it just mirrors them into the config table so they'll be exposed there.

@vathpela
Copy link
Member Author

Note that this is now on top of #660

@vathpela vathpela force-pushed the mirror-more-stuff branch 2 times, most recently from 9e22a36 to c269276 Compare February 19, 2025 20:30
@vathpela vathpela requested a review from jsetje February 19, 2025 20:32
@vathpela vathpela marked this pull request as ready for review February 19, 2025 20:32
@vathpela vathpela force-pushed the mirror-more-stuff branch 2 times, most recently from 6fbdcd3 to 33410e0 Compare February 21, 2025 00:28
Copy link
Collaborator

@jsetje jsetje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we want some way to disable the mirroring entirely. Something like MOK_VARIABLE_NOTHING ? I certainly don't want this by default, but some light memory only configs might want to be able to save the space.

This debug printf in our mock variable test code, which isn't normally
enabled, has a missing comma at the end of the format specifier.  This
causes __FILE__ to be part of the format specifier, which then means
we've got a missing parameter and also the types don't match up like
you'd hope.

This causes the most confusing segfaults.

Signed-off-by: Peter Jones <pjones@redhat.com>
This changes test-mock-variables and related code to not print all debug
messages at SHIM_DEBUG=1, and also adds some prints and comments for
context as to what's going on in the tests.

Signed-off-by: Peter Jones <pjones@redhat.com>
Previously the mok mirror state flags were only used in the mok
mirroring code.  But there are other consumers of that data, namely our
variable test cases, and it's useful for them to be able to check the
flags.

Signed-off-by: Peter Jones <pjones@redhat.com>
Some machines have EFI Boot Services variables but not Runtime
variables, and thus it can be quite difficult to figure out what's going
on once the system is booted.

This changes mok variable mirroring to also mirror the following
variables to the mok variable config table:

  AuditMode
  BootOrder
  BootCurrent
  BootNext
  Boot0000
  Boot0001
  Boot0002
  Boot0003
  Boot0004
  Boot0005
  Boot0006
  DeployedMode
  SecureBoot
  SetupMode
  SignatureSupport
  Timeout
  PK
  KEK
  db
  dbx
  Kernel_SkuSiStatus

There's no attempt to do anything involving creating runtime or
boot-services only variables, it just mirrors them into the config
table so they'll be exposed there.

Signed-off-by: Peter Jones <pjones@redhat.com>
@vathpela vathpela merged commit fc0cfac into rhboot:main Feb 24, 2025
4 checks passed
@vathpela vathpela deleted the mirror-more-stuff branch February 24, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants