summaryrefslogtreecommitdiff
path: root/rseq-nptl-rseq-failure-after-registration-on-main-thread-.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-03 06:28:41 +0000
commitd20db0561a6a36f914fde030512503b114ef9a0c (patch)
treed4e5e3494d95c269a1cee6195f11bf3201bcadbf /rseq-nptl-rseq-failure-after-registration-on-main-thread-.patch
parent016343d99b1b269d7246ef1e143d4b54914433d4 (diff)
Diffstat (limited to 'rseq-nptl-rseq-failure-after-registration-on-main-thread-.patch')
-rw-r--r--rseq-nptl-rseq-failure-after-registration-on-main-thread-.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/rseq-nptl-rseq-failure-after-registration-on-main-thread-.patch b/rseq-nptl-rseq-failure-after-registration-on-main-thread-.patch
new file mode 100644
index 0000000..7fd271a
--- /dev/null
+++ b/rseq-nptl-rseq-failure-after-registration-on-main-thread-.patch
@@ -0,0 +1,44 @@
+From 210967ce32172eb7356747ed0b655e1fc37d0c57 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Thu, 9 Dec 2021 09:49:32 +0100
+Subject: [PATCH 8/9] nptl: rseq failure after registration on main thread is
+ fatal
+
+This simplifies the application programming model.
+
+Browser sandboxes have already been fixed:
+
+ Sandbox is incompatible with rseq registration
+ <https://bugzilla.mozilla.org/show_bug.cgi?id=1651701>
+
+ Allow rseq in the Linux sandboxes. r=gcp
+ <https://hg.mozilla.org/mozilla-central/rev/042425712eb1>
+
+ Sandbox needs to support rseq system call
+ <https://bugs.chromium.org/p/chromium/issues/detail?id=1104160>
+
+ Linux sandbox: Allow rseq(2)
+ <https://chromium.googlesource.com/chromium/src.git/+/230675d9ac8f1>
+
+Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
+---
+ nptl/pthread_create.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
+index f405fa35..109c5e3d 100644
+--- a/nptl/pthread_create.c
++++ b/nptl/pthread_create.c
+@@ -371,7 +371,8 @@ start_thread (void *arg)
+ /* Register rseq TLS to the kernel. */
+ {
+ bool do_rseq = THREAD_GETMEM (pd, flags) & ATTR_FLAG_DO_RSEQ;
+- rseq_register_current_thread (pd, do_rseq);
++ if (!rseq_register_current_thread (pd, do_rseq) && do_rseq)
++ __libc_fatal ("Fatal glibc error: rseq registration failed\n");
+ }
+
+ #ifndef __ASSUME_SET_ROBUST_LIST
+--
+2.23.0
+