diff mbox series

[v2,8/8] nptl: rseq failure after registration on main thread is fatal

Message ID 354a2d43774aeca68104a6230caa4be7141ed43b.1638880889.git.fweimer@redhat.com
State Committed
Commit a41c8e92350e744a4bc639df5025153d05263e7f
Headers show
Series Extensible rseq integration | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Florian Weimer Dec. 7, 2021, 1:04 p.m. UTC
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>
---
v2: New patch.  Tested with Firefox 94.0 on Fedora 35.

 nptl/pthread_create.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Szabolcs Nagy Dec. 8, 2021, 5:36 p.m. UTC | #1
The 12/07/2021 14:04, Florian Weimer via Libc-alpha wrote:
> 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>
> ---
> v2: New patch.  Tested with Firefox 94.0 on Fedora 35.

looks good.

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 4608fd9068..c097fc54e6 100644
> --- a/nptl/pthread_create.c
> +++ b/nptl/pthread_create.c
> @@ -370,7 +370,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.33.1
>
diff mbox series

Patch

diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 4608fd9068..c097fc54e6 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -370,7 +370,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