Package: efivar / 37-6

guids.S-Include-cet.h-when-CET-is-enabled.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 478b37bcb7596ccae74565ad0a371f14b5542b54 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sun, 1 Mar 2020 04:10:58 -0800
Subject: [PATCH] guids.S: Include <cet.h> when CET is enabled

Intel Control-flow Enforcement Technology (CET):

https://software.intel.com/en-us/articles/intel-sdm

contains shadow stack (SHSTK) and indirect branch tracking (IBT). When
CET is enabled, ELF object files must be marked with .note.gnu.property
section. CET enabled GCC provides a header file, <cet.h>, which can be
included in assembly files to generate the CET marker automatically.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 src/guids.S | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/guids.S b/src/guids.S
index f8541a9..56356d2 100644
--- a/src/guids.S
+++ b/src/guids.S
@@ -28,5 +28,8 @@ efi_well_known_names_end:
 	.byte 0
 
 #if defined(__linux__) && defined(__ELF__)
+#if defined(__CET__) && (defined(__i386__) || defined(__x86_64__))
+#include <cet.h>
+#endif
 .section .note.GNU-stack,"",%progbits
 #endif
-- 
2.28.0