Skip to content

efi: fix and verify variables append_write

Vincent Stehlé u-boot 1 version In review

Get series with b4
b4 am [email protected] change-id 20261113-append-1cfc64c0e0d8

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2efi_loader: prevent set_variable() to record append_writelib/efi_loader/efi_variable.c+2 -11 reply
2/2efi_selftest: verify get_variable() never returns append_writelib/efi_selftest/efi_selftest_variables.c+16 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] efi: fix and verify variables append_write

This couple of patches does the following:
- Fix a corner case of the non-TEE SetVariable(), which could record the APPEND_WRITE attribute when appending to non-existing variables.
- Enhance the existing selftest to verify that the APPEND_WRITE attribute is never returned by GetVariable().

See the second patch for the details to run on the sandbox.

I have also verified that the selftest changes do not harm with OP-TEE + StMM. (This hits other issues with QueryVariableInfo() but they are unrelated.)

We could reasonably reduce the test to verify the attributes only in the cases where GetVariable() follows a SetVariable() with the append attribute set, as those are arguably more likely to be buggy.
If this is preferred just let me know and I will send a v2.

---
Vincent Stehlé (2):
efi_loader: prevent set_variable() to record append_write
efi_selftest: verify get_variable() never returns append_write

 lib/efi_loader/efi_variable.c             |  3 ++-
 lib/efi_selftest/efi_selftest_variables.c | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

---
base-commit: ff8a9bc41e4e5bdd3406932af5abb4c18064e539
change-id: 20261113-append-1cfc64c0e0d8

Best regards,

Signature · 1 line
Vincent.