From: Florian Weimer Date: Thu, 9 Dec 2021 08:49:32 +0000 (+0100) Subject: nptl: rseq failure after registration on main thread is fatal X-Git-Tag: glibc-2.35~275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a41c8e92350e744a4bc639df5025153d05263e7f;p=thirdparty%2Fglibc.git 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 Allow rseq in the Linux sandboxes. r=gcp Sandbox needs to support rseq system call Linux sandbox: Allow rseq(2) Reviewed-by: Szabolcs Nagy --- diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index 4608fd9068a..c097fc54e6c 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