0001-secureboot.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 0a65c8b311295b6fda9386f397a4adc1e3dc28b5 Mon Sep 17 00:00:00 2001
  2. From: Maximilian Luz <luzmaximilian@gmail.com>
  3. Date: Sun, 9 Jun 2024 19:48:58 +0200
  4. Subject: [PATCH] Revert "efi/x86: Set the PE/COFF header's NX compat flag
  5. unconditionally"
  6. This reverts commit 891f8890a4a3663da7056542757022870b499bc1.
  7. Revert because of compatibility issues of MS Surface devices and GRUB
  8. with NX. In short, these devices get stuck on boot with NX advertised.
  9. So to not advertise it, add the respective option back in.
  10. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
  11. Patchset: secureboot
  12. ---
  13. arch/x86/boot/header.S | 4 ++++
  14. 1 file changed, 4 insertions(+)
  15. diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
  16. index b5c79f43359b..a1bbedd989e4 100644
  17. --- a/arch/x86/boot/header.S
  18. +++ b/arch/x86/boot/header.S
  19. @@ -111,7 +111,11 @@ extra_header_fields:
  20. .long salign # SizeOfHeaders
  21. .long 0 # CheckSum
  22. .word IMAGE_SUBSYSTEM_EFI_APPLICATION # Subsystem (EFI application)
  23. +#ifdef CONFIG_EFI_DXE_MEM_ATTRIBUTES
  24. .word IMAGE_DLL_CHARACTERISTICS_NX_COMPAT # DllCharacteristics
  25. +#else
  26. + .word 0 # DllCharacteristics
  27. +#endif
  28. #ifdef CONFIG_X86_32
  29. .long 0 # SizeOfStackReserve
  30. .long 0 # SizeOfStackCommit
  31. --
  32. 2.45.2