From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C95E13870841; Tue, 9 Jun 2020 09:34:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C95E13870841 From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug nptl/25098] nptl: ctype classification functions are not AS-Safe Date: Tue, 09 Jun 2020 09:34:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: fweimer at redhat dot com X-Bugzilla-Target-Milestone: 2.32 X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: resolution cc target_milestone bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2020 09:34:20 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25098 Florian Weimer changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |fweimer at redhat dot com Target Milestone|--- |2.32 Status|ASSIGNED |RESOLVED --- Comment #2 from Florian Weimer --- Fixed for glibc 2.32: commit b3cae39dcbfa2432b3f3aa28854d8ac57f0de1b8 Author: Florian Weimer Date: Mon Apr 27 09:55:10 2020 +0200 nptl: Start new threads with all signals blocked [BZ #25098] New threads inherit the signal mask from the current thread. This means that signal handlers can run on the newly created thread immediately after the kernel has created the userspace thread, even before glibc has initialized the TCB. Consequently, new threads can observe uninitialized ctype data, among other things. To address this, block all signals before starting the thread, and pass the original signal mask to the start routine wrapper. On the new thread, first perform all thread initialization, and then unblock signals. The cost of doing this is two rt_sigprocmask system calls on the old thread, and one rt_sigprocmask system call on the new thread. (If there was a way to clone a new thread with a signals disabled, this could be brought down to one system call each.) The thread descriptor increases in size, too, and sigset_t is fairly large. This increase could be brought down by reusing space the in the descriptor which is not needed before running user code, or by switching to an internal sigset_t definition which only covers the signals supported by the kernel definition. (Part of the thread descriptor size increase is already offset by reduced stack usage in the thread start wrapper routine after this commit.) Reviewed-by: Carlos O'Donell Also needs the following regression fix (plus its dependencies): commit ba9f6ee9bb8a894c9e2fb715edf693dd157b420a Author: Florian Weimer Date: Tue May 19 12:03:44 2020 +0200 Linux: Use __pthread_attr_setsigmask_internal for timer helper thread timer_create needs to create threads with all signals blocked, including SIGTIMER (which happens to equal SIGCANCEL). Fixes commit b3cae39dcbfa2432b3f3aa28854d8ac57f0de1b8 ("nptl: Start new threads with all signals blocked [BZ #25098]"). Reviewed-by: Carlos O'Donell --=20 You are receiving this mail because: You are on the CC list for the bug.=