0029-efi-Make-shim_lock-GUID-and-protocol-type-public.patch 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. From f76a27996c34900f2c369a8a0d6ac72ae2faa988 Mon Sep 17 00:00:00 2001
  2. From: Daniel Kiper <daniel.kiper@oracle.com>
  3. Date: Thu, 3 Dec 2020 16:01:45 +0100
  4. Subject: [PATCH] efi: Make shim_lock GUID and protocol type public
  5. The GUID will be used to properly detect and report UEFI Secure Boot
  6. status to the x86 Linux kernel. The functionality will be added by
  7. subsequent patches. The shim_lock protocol type is made public for
  8. completeness.
  9. Additionally, fix formatting of four preceding GUIDs.
  10. Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
  11. Signed-off-by: Marco A Benatto <mbenatto@redhat.com>
  12. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
  13. Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
  14. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
  15. ---
  16. grub-core/commands/efi/shim_lock.c | 12 ------------
  17. include/grub/efi/api.h | 19 +++++++++++++++----
  18. 2 files changed, 15 insertions(+), 16 deletions(-)
  19. diff --git a/grub-core/commands/efi/shim_lock.c b/grub-core/commands/efi/shim_lock.c
  20. index 764098c..d8f52d7 100644
  21. --- a/grub-core/commands/efi/shim_lock.c
  22. +++ b/grub-core/commands/efi/shim_lock.c
  23. @@ -27,18 +27,6 @@
  24. GRUB_MOD_LICENSE ("GPLv3+");
  25. -#define GRUB_EFI_SHIM_LOCK_GUID \
  26. - { 0x605dab50, 0xe046, 0x4300, \
  27. - { 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } \
  28. - }
  29. -
  30. -struct grub_efi_shim_lock_protocol
  31. -{
  32. - grub_efi_status_t
  33. - (*verify) (void *buffer, grub_uint32_t size);
  34. -};
  35. -typedef struct grub_efi_shim_lock_protocol grub_efi_shim_lock_protocol_t;
  36. -
  37. static grub_efi_guid_t shim_lock_guid = GRUB_EFI_SHIM_LOCK_GUID;
  38. static grub_efi_shim_lock_protocol_t *sl;
  39. diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
  40. index cf1355a..13e5715 100644
  41. --- a/include/grub/efi/api.h
  42. +++ b/include/grub/efi/api.h
  43. @@ -316,22 +316,27 @@
  44. #define GRUB_EFI_SAL_TABLE_GUID \
  45. { 0xeb9d2d32, 0x2d88, 0x11d3, \
  46. - { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
  47. + { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
  48. }
  49. #define GRUB_EFI_HCDP_TABLE_GUID \
  50. { 0xf951938d, 0x620b, 0x42ef, \
  51. - { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \
  52. + { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \
  53. }
  54. #define GRUB_EFI_DEVICE_TREE_GUID \
  55. { 0xb1b621d5, 0xf19c, 0x41a5, \
  56. - { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \
  57. + { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \
  58. }
  59. #define GRUB_EFI_VENDOR_APPLE_GUID \
  60. { 0x2B0585EB, 0xD8B8, 0x49A9, \
  61. - { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \
  62. + { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \
  63. + }
  64. +
  65. +#define GRUB_EFI_SHIM_LOCK_GUID \
  66. + { 0x605dab50, 0xe046, 0x4300, \
  67. + { 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } \
  68. }
  69. struct grub_efi_sal_system_table
  70. @@ -1689,6 +1694,12 @@ struct grub_efi_block_io
  71. };
  72. typedef struct grub_efi_block_io grub_efi_block_io_t;
  73. +struct grub_efi_shim_lock_protocol
  74. +{
  75. + grub_efi_status_t (*verify) (void *buffer, grub_uint32_t size);
  76. +};
  77. +typedef struct grub_efi_shim_lock_protocol grub_efi_shim_lock_protocol_t;
  78. +
  79. #if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \
  80. || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) \
  81. || defined(__riscv)
  82. --
  83. 2.14.2