]>
Commit | Line | Data |
---|---|---|
cf870e72 SM |
1 | commit 822d07ad4f07ef66fe447a130e1027c88d02a394 |
2 | Author: Adam Williamson <awilliam@redhat.com> | |
3 | Date: Thu Apr 8 22:39:02 2021 -0700 | |
4 | ||
5 | Fix handling of ignore_db and user_insecure_mode | |
6 | ||
7 | In 65be350308783a8ef537246c8ad0545b4e6ad069, import_mok_state() is split | |
8 | up into a function that manages the whole mok state, and one that | |
9 | handles the state machine for an individual state variable. | |
10 | Unfortunately, the code that initializes the global ignore_db and | |
11 | user_insecure_mode was copied from import_mok_state() into the new | |
12 | import_one_mok_state() function, and thus re-initializes that state each | |
13 | time it processes a MoK state variable, before even assessing if that | |
14 | variable is set. As a result, we never honor either flag, and the | |
15 | machine owner cannot disable trusting the system firmware's db/dbx | |
16 | databases or disable validation altogether. | |
17 | ||
18 | This patch removes the extra re-initialization, allowing those variables | |
19 | to be set properly. | |
20 | ||
21 | Signed-off-by: Adam Williamson <awilliam@redhat.com> | |
22 | ||
23 | diff --git a/mok.c b/mok.c | |
24 | index 5ad9072b..9e37d6ab 100644 | |
25 | --- a/mok.c | |
26 | +++ b/mok.c | |
27 | @@ -888,9 +888,6 @@ EFI_STATUS import_one_mok_state(struct mok_state_variable *v, | |
28 | EFI_STATUS ret = EFI_SUCCESS; | |
29 | EFI_STATUS efi_status; | |
30 | ||
31 | - user_insecure_mode = 0; | |
32 | - ignore_db = 0; | |
33 | - | |
34 | UINT32 attrs = 0; | |
35 | BOOLEAN delete = FALSE; | |
36 |