public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "fweimer at redhat dot com" <sourceware-bugzilla@sourceware.org> 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 [thread overview] Message-ID: <bug-25098-131-iS8A5yM2uq@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-25098-131@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=25098 Florian Weimer <fweimer at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |fweimer at redhat dot com Target Milestone|--- |2.32 Status|ASSIGNED |RESOLVED --- Comment #2 from Florian Weimer <fweimer at redhat dot com> --- Fixed for glibc 2.32: commit b3cae39dcbfa2432b3f3aa28854d8ac57f0de1b8 Author: Florian Weimer <fweimer@redhat.com> 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 <carlos@redhat.com> Also needs the following regression fix (plus its dependencies): commit ba9f6ee9bb8a894c9e2fb715edf693dd157b420a Author: Florian Weimer <fweimer@redhat.com> 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 <carlos@redhat.com> -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2020-06-09 9:34 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-25098-131@http.sourceware.org/bugzilla/> 2019-10-14 12:34 ` fweimer at redhat dot com 2020-06-09 9:34 ` fweimer at redhat dot com [this message] 2021-05-27 0:32 ` adhemerval.zanella at linaro dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-25098-131-iS8A5yM2uq@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).