From: Christian Brauner <christian.brauner@ubuntu.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Carlos O'Donell <carlos@redhat.com>,
libc-alpha@sourceware.org, Joseph Myers <joseph@codesourcery.com>
Subject: Re: [RFC PATCH glibc 3/8] nptl: Start new threads with all signals blocked [BZ #25098]
Date: Mon, 23 Mar 2020 16:31:56 +0100 [thread overview]
Message-ID: <20200323153156.hpdjqghjscivggjf@wittgenstein> (raw)
In-Reply-To: <20200323131607.15185-4-mathieu.desnoyers@efficios.com>
On Mon, Mar 23, 2020 at 09:16:02AM -0400, Mathieu Desnoyers via Libc-alpha wrote:
> From: Florian Weimer <fweimer@redhat.com>
>
> 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
This could be a new clone3() flag. If someone wants to send a patch I'd
take it.
Christian
next prev parent reply other threads:[~2020-03-23 15:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 13:15 [RFC PATCH glibc 0/8] Restartable Sequences enablement Mathieu Desnoyers
2020-03-23 13:16 ` [RFC PATCH glibc 1/8] Introduce <elf_machine_sym_no_match.h> Mathieu Desnoyers
2020-03-23 14:51 ` H.J. Lu
2020-03-23 17:04 ` Mathieu Desnoyers
2020-03-23 13:16 ` [RFC PATCH glibc 2/8] Implement __libc_early_init Mathieu Desnoyers
2020-03-23 13:16 ` [RFC PATCH glibc 3/8] nptl: Start new threads with all signals blocked [BZ #25098] Mathieu Desnoyers
2020-03-23 15:31 ` Christian Brauner [this message]
2020-03-23 17:02 ` Mathieu Desnoyers
2020-03-23 17:05 ` Christian Brauner
2020-04-22 16:38 ` Carlos O'Donell
2020-03-23 13:16 ` [RFC PATCH glibc 4/8] glibc: Perform rseq(2) registration at C startup and thread creation (v16) Mathieu Desnoyers
2020-03-23 22:01 ` Joseph Myers
2020-03-24 13:08 ` Mathieu Desnoyers
2020-03-24 18:58 ` Joseph Myers
2020-03-24 19:44 ` Mathieu Desnoyers
2020-03-23 13:16 ` [RFC PATCH glibc 5/8] glibc: sched_getcpu(): use rseq cpu_id TLS on Linux (v7) Mathieu Desnoyers
2020-03-23 13:16 ` [RFC PATCH glibc 6/8] support record failure: allow use from constructor Mathieu Desnoyers
2020-03-23 13:16 ` [RFC PATCH glibc 7/8] support: implement xpthread key create/delete (v4) Mathieu Desnoyers
2020-03-23 13:16 ` [RFC PATCH glibc 8/8] rseq registration tests (v9) Mathieu Desnoyers
-- strict thread matches above, loose matches on Subject: below --
2020-03-19 14:41 [RFC PATCH glibc 0/8] Restartable Sequences enablement Mathieu Desnoyers
2020-03-19 14:41 ` [RFC PATCH glibc 3/8] nptl: Start new threads with all signals blocked [BZ #25098] Mathieu Desnoyers
2020-01-08 14:59 [RFC PATCH glibc 0/8] Restartable Sequences enablement Mathieu Desnoyers
2020-01-08 14:59 ` [RFC PATCH glibc 3/8] nptl: Start new threads with all signals blocked [BZ #25098] Mathieu Desnoyers
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=20200323153156.hpdjqghjscivggjf@wittgenstein \
--to=christian.brauner@ubuntu.com \
--cc=carlos@redhat.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=mathieu.desnoyers@efficios.com \
/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: link
Be 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).