forked from pool/libglvnd
Accepting request 957396 from home:Guillaume_G:branches:X11:XOrg
- Update libglvnd-add-bti.patch from latest upstream submission OBS-URL: https://build.opensuse.org/request/show/957396 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libglvnd?expand=0&rev=59
This commit is contained in:
parent
475a9feeb1
commit
c4d791a5c6
@ -1,34 +1,37 @@
|
||||
From 5dc67a6310e32e0d36527c4eaa1b92c39beb8c8c Mon Sep 17 00:00:00 2001
|
||||
From 7107f739398cd96600b039fd748cb1c4822bb400 Mon Sep 17 00:00:00 2001
|
||||
From: Guillaume Gardet <guillaume.gardet@arm.com>
|
||||
Date: Fri, 21 Jan 2022 09:26:07 +0100
|
||||
Subject: [PATCH] Add BTI landing pads for aarch64
|
||||
|
||||
When Branch Target Identifier (BTI) is enabled on aarch64,
|
||||
any software which run libglbnd will fail with SIGILL, Illegal instruction.
|
||||
any software which run libglvnd will fail with SIGILL, Illegal instruction.
|
||||
This is because some assembler code misses the BTI landing pads.
|
||||
See: https://developer.arm.com/documentation/102433/0100/Jump-oriented-programming
|
||||
|
||||
"hint #34" is the same thing as "BTI C" landing pad, but keep
|
||||
compatibility with systems without BTI enabled.
|
||||
---
|
||||
src/GLdispatch/vnd-glapi/entry_aarch64_tsd.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
src/GLX/glvnd_genentry.c | 1 +
|
||||
src/GLdispatch/vnd-glapi/entry_aarch64_tsd.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/GLX/glvnd_genentry.c b/src/GLX/glvnd_genentry.c
|
||||
index 7bbe811..b82aa14 100644
|
||||
--- a/src/GLX/glvnd_genentry.c
|
||||
+++ b/src/GLX/glvnd_genentry.c
|
||||
@@ -90,6 +90,7 @@ extern char glx_entrypoint_end[];
|
||||
|
||||
#define STUB_SIZE 16
|
||||
#define STUB_ASM_ARCH(slot) \
|
||||
+ "hint #34\n" \
|
||||
"adrp x16, entrypointFunctions + " slot "*8\n" \
|
||||
"ldr x16, [x16, #:lo12:(entrypointFunctions + " slot "*8)]\n" \
|
||||
"br x16\n"
|
||||
diff --git a/src/GLdispatch/vnd-glapi/entry_aarch64_tsd.c b/src/GLdispatch/vnd-glapi/entry_aarch64_tsd.c
|
||||
index ae80131..00c4132 100644
|
||||
index ae80131..a4652e0 100644
|
||||
--- a/src/GLdispatch/vnd-glapi/entry_aarch64_tsd.c
|
||||
+++ b/src/GLdispatch/vnd-glapi/entry_aarch64_tsd.c
|
||||
@@ -55,7 +55,8 @@
|
||||
".balign " U_STRINGIFY(ENTRY_STUB_ALIGN) "\n\t" \
|
||||
".global " func "\n\t" \
|
||||
".type " func ", %function\n\t" \
|
||||
- func ":\n\t"
|
||||
+ func ":\n\t" \
|
||||
+ "hint #34\n\t"
|
||||
|
||||
/*
|
||||
* Looks up the current dispatch table, finds the stub address at the given slot
|
||||
@@ -69,6 +70,7 @@
|
||||
@@ -69,6 +69,7 @@
|
||||
* table then does a branch without link to the function address.
|
||||
*/
|
||||
#define STUB_ASM_CODE(slot) \
|
||||
@ -36,3 +39,6 @@ index ae80131..00c4132 100644
|
||||
"stp x1, x0, [sp, #-16]!\n\t" \
|
||||
"adrp x0, :got:_glapi_Current\n\t" \
|
||||
"ldr x0, [x0, #:got_lo12:_glapi_Current]\n\t" \
|
||||
--
|
||||
2.35.1
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 24 15:23:24 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
- Update libglvnd-add-bti.patch from latest upstream submission
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 21 09:05:39 UTC 2022 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||
|
||||
|
@ -29,7 +29,7 @@ Source: https://github.com/NVIDIA/libglvnd/archive/v%{version}.tar.gz#/%
|
||||
Source1: baselibs.conf
|
||||
Source2: libglvnd.rpmlintrc
|
||||
Patch1: disable-glx-tests.patch
|
||||
# PATCH-FIX-UPSTREAM - https://github.com/NVIDIA/libglvnd/pull/214
|
||||
# PATCH-FIX-UPSTREAM - https://gitlab.freedesktop.org/glvnd/libglvnd/-/merge_requests/262
|
||||
Patch2: libglvnd-add-bti.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
|
Loading…
Reference in New Issue
Block a user