Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20201019224342.53303-3-joao.moreira@intel.com>
Date: Mon, 19 Oct 2020 15:43:40 -0700
From: Joao Moreira <joao.moreira@...el.com>
To: musl@...ts.openwall.com
Subject: [PATCH 2/4] Add ENDBRANCH64 and ENDBRANCH32 macro definitions

Define ENDBRANCH64 and ENDBRANCH32 macros to endbr64 and endbr32 instructions,
respectively, in case the flag CET_IBT is set. If the flag is not set, the
macros are defined to nothing.

These macros will later be used to properly add endbranch instruction to
x86 and i386 assembly functions.

Signed-off-by: Joao Moreira <joao.moreira@...el.com>
---
 src/include/ibt.s | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 src/include/ibt.s

diff --git a/src/include/ibt.s b/src/include/ibt.s
new file mode 100644
index 00000000..2f16006f
--- /dev/null
+++ b/src/include/ibt.s
@@ -0,0 +1,13 @@
+.ifdef CET_IBT
+	.macro ENDBRANCH64
+		endbr64
+	.endm
+	.macro ENDBRANCH32
+		endbr32
+	.endm
+.else
+	.macro ENDBRANCH64
+	.endm
+	.macro ENDBRANCH32
+	.endm
+.endif
-- 
2.27.0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.