From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 325953858013 for ; Tue, 7 Dec 2021 13:04:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 325953858013 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-58--2-tGj9MPIKpp7J4s6LjKw-1; Tue, 07 Dec 2021 08:04:35 -0500 X-MC-Unique: -2-tGj9MPIKpp7J4s6LjKw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3ECA210144F3 for ; Tue, 7 Dec 2021 13:04:34 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 964D75D9C0 for ; Tue, 7 Dec 2021 13:04:33 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v2 8/8] nptl: rseq failure after registration on main thread is fatal In-Reply-To: References: X-From-Line: 354a2d43774aeca68104a6230caa4be7141ed43b Mon Sep 17 00:00:00 2001 Message-Id: <354a2d43774aeca68104a6230caa4be7141ed43b.1638880889.git.fweimer@redhat.com> Date: Tue, 07 Dec 2021 14:04:31 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Dec 2021 13:04:47 -0000 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) --- v2: New patch. Tested with Firefox 94.0 on Fedora 35. 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