0001-Partially-revert-integrity-Only-use-machine-keyring-.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 1fb0cb1a5de985b6b8728f6a39660fcd5df29977 Mon Sep 17 00:00:00 2001
  2. From: Maximilian Luz <luzmaximilian@gmail.com>
  3. Date: Mon, 20 Nov 2023 22:54:05 +0100
  4. Subject: [PATCH] Partially revert "integrity: Only use machine keyring when
  5. uefi_check_trust_mok_keys is true"
  6. This partially reverts commit 3d6ae1a5d0c2019d274284859f556dcb64aa98a7.
  7. MokListTrustedRT doesn't seem to be set by the Shim version used by
  8. Ubuntu and Debian. Therefore, these systems don't trust the MOK keys on
  9. newer kernels. While pre-5.19 kernels silently disregard the untrusted
  10. keys and (without signature enforcement enabled) still load external
  11. modules (tainting the kernel), on 5.19 kernels, this breaks module
  12. loading. Therefore, revert this change.
  13. ---
  14. security/integrity/platform_certs/machine_keyring.c | 9 +--------
  15. 1 file changed, 1 insertion(+), 8 deletions(-)
  16. diff --git a/security/integrity/platform_certs/machine_keyring.c b/security/integrity/platform_certs/machine_keyring.c
  17. index a401640a63cd..a1ad244cbf86 100644
  18. --- a/security/integrity/platform_certs/machine_keyring.c
  19. +++ b/security/integrity/platform_certs/machine_keyring.c
  20. @@ -51,14 +51,7 @@ void __init add_to_machine_keyring(const char *source, const void *data, size_t
  21. */
  22. static __init bool uefi_check_trust_mok_keys(void)
  23. {
  24. - struct efi_mokvar_table_entry *mokvar_entry;
  25. -
  26. - mokvar_entry = efi_mokvar_entry_find("MokListTrustedRT");
  27. -
  28. - if (mokvar_entry)
  29. - return true;
  30. -
  31. - return false;
  32. + return true;
  33. }
  34. static bool __init trust_moklist(void)
  35. --
  36. 2.49.0