Skip to content

Commit ef68255

Browse files
committed
Intel x86 asm: Add endbr[64|32] to all symbols
Suggested-by: Daiki Ueno <dueno@redhat.com> Signed-off-by: Stephan Mueller <smueller@chronox.de>
1 parent 509f424 commit ef68255

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Changes 1.2.1-prerelease
77

88
* Meson: reduce number of object files to speed up compilation process
99

10+
* Intel assembler: add endbr[64|32] to every function and ensure IBT is enabled
11+
1012
Changes 1.2.0
1113
* Locking für seeded_rng added to avoid requiring the caller providing a lock
1214

internal/api/assembler_support.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
#ifndef ASSEMBLER_SUPPORT_H
2121
#define ASSEMBLER_SUPPORT_H
2222

23+
#ifdef __x86_64__
24+
#define LC_ENDBR "endbr64"
25+
#elif defined(__i386__)
26+
#define LC_ENDBR "endbr32"
27+
#else
28+
#define LC_ENDBR
29+
#endif
30+
2331
#ifdef LINUX_KERNEL
2432

2533
#include <linux/linkage.h>
@@ -121,7 +129,8 @@
121129
# define SYM_FUNC_START(name) \
122130
.hidden SYM_FUNC(name) ; \
123131
.global SYM_FUNC(name) ; \
124-
SYM_FUNC(name):
132+
SYM_FUNC(name): \
133+
LC_ENDBR
125134

126135
# define SYM_FUNC_ENTER(name)
127136

0 commit comments

Comments
 (0)