cmd: nvedit_efi: fix default GUID selection for signature databases
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 0 repliesNew
- v12 patches 2 repliesSuperseded
Changes in v2 from the cover letter
- also check that PK and KEK are created under the global variable GUID and not under the image security database GUID (suggested by Heinrich Schuchardt)
- patch 1: collect Reviewed-by tag, no code changes
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | cmd: nvedit_efi: use efi_auth_var_get_guid() for the default GUIDcmd/ | +8 | 0 replies | |
| 2/2 | test: check default GUID selection of signature database variablestest/ test/ | +55 | 0 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Heinrich Schuchardt |
|---|---|
| 1/2 | R-b |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] cmd: nvedit_efi: fix default GUID selection for signature databases
"env set -e" selects a default vendor GUID when no -guid option is given, using a hand rolled name check in do_env_set_efi(). That check has drifted from the canonical name_type[] table in lib/efi_loader/efi_var_common.c: it knows db, dbx and dbt but not dbr, so "env set -e dbr" silently operates on a variable under EFI_GLOBAL_VARIABLE_GUID instead of the image security database GUID, creating a variable that no consumer will ever look up. The command also unmapped the -i value buffer twice, which triggers a spurious "Address not mapped" warning on sandbox for addresses that get a tagged mapping.
Patch 1 replaces the hand rolled check with a call to efi_auth_var_get_guid() so that the shell command and the variable service share a single table, and consolidates the value and name cleanup on the common exit path. Behaviour is unchanged for db, dbx, dbt and for non-authenticated variable names.
Patch 2 adds a test case to the sandbox secure boot suite that enrolls each of db, dbx, dbt and dbr in setup mode without an explicit -guid option and checks that every variable is created under the image security database GUID and not under the global variable GUID, then enrolls PK and KEK the same way and checks that both land under the global variable GUID. This is the first coverage of dbt and dbr under test/. The signature database enrollment happens in setup mode because once secure boot is enabled, efi_variable_authenticate() only accepts writes to PK, KEK, db and dbx. The new test fails at the dbr step without patch 1.
Changes in v2:
- also check that PK and KEK are created under the global variable GUID and not under the image security database GUID (suggested by Heinrich Schuchardt)
- patch 1: collect Reviewed-by tag, no code changes
Aristo Chen (2):
cmd: nvedit_efi: use efi_auth_var_get_guid() for the default GUID
test: check default GUID selection of signature database variables
cmd/nvedit_efi.c | 22 ++++----- test/py/tests/test_efi_secboot/conftest.py | 8 ++++ .../py/tests/test_efi_secboot/test_authvar.py | 47 +++++++++++++++++++ 3 files changed, 63 insertions(+), 14 deletions(-)
Signature · 1 line
2.43.0