Skip to content

Commit

Permalink
Fix handling of ignore_db and user_insecure_mode
Browse files Browse the repository at this point in the history
In 65be350, import_mok_state() is split
up into a function that manages the whole mok state, and one that
handles the state machine for an individual state variable.
Unfortunately, the code that initializes the global ignore_db and
user_insecure_mode was copied from import_mok_state() into the new
import_one_mok_state() function, and thus re-initializes that state each
time it processes a MoK state variable, before even assessing if that
variable is set.  As a result, we never honor either flag, and the
machine owner cannot disable trusting the system firmware's db/dbx
databases or disable validation altogether.

This patch removes the extra re-initialization, allowing those variables
to be set properly.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
  • Loading branch information
AdamWill authored and vathpela committed Apr 9, 2021
1 parent 20e4d94 commit 822d07a
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions mok.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,6 @@ EFI_STATUS import_one_mok_state(struct mok_state_variable *v,
EFI_STATUS ret = EFI_SUCCESS;
EFI_STATUS efi_status;

user_insecure_mode = 0;
ignore_db = 0;

UINT32 attrs = 0;
BOOLEAN delete = FALSE;

Expand Down

0 comments on commit 822d07a

Please sign in to comment.