From: Peter Zijlstra <peterz@infradead.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "Jann Horn" <jannh@google.com>, "Hyunwoo Kim" <imv4bel@gmail.com>,
"Thomas Gleixner" <tglx@kernel.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Darren Hart" <dvhart@infradead.org>,
"Davidlohr Bueso" <dave@stgolabs.net>,
"André Almeida" <andrealmeid@igalia.com>,
"kernel list" <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] futex: scheduling-while-atomic because nested vfork can break guard(private_hash)
Date: Tue, 15 Sep 2026 13:37:34 +0200 [thread overview]
Message-ID: <20260915113734.GA2009045@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260915110619.Zp_jM61a@linutronix.de>
On Tue, Sep 15, 2026 at 01:06:19PM +0200, Sebastian Andrzej Siewior wrote:
> On 2026-09-11 11:04:47 [+0200], Peter Zijlstra wrote:
> > So I can confirm that the below does in fact cure your testcase.
> >
> > Per commit: ee9dce44362b ("futex: Drop CLONE_THREAD requirement for private default hash alloc")
> > the reason for excluding vfork() was performance and thinking this
> > would/could not matter, which you've proven to be clearly false.
> >
> > Thomas?
>
> in v2 I moved everything struct signal because the private hash should
> live there as per review. This explains the original check in
> need_futex_hash_allocate_default(). In v3 I moved to mm while the check
> remained unchanged.
>
> The mm is cloned on CLONE_VM. Kernel threads don't get a private hash
> due to mm == NULL check in futex_hash_allocate_default() which was added
> in v4 with auto-resize.
>
> To get the whole magic to work, we need to create the private hash once
> the first "parallel" user is created, the first thread.
> Skipping it for CLONE_VFORK violates this. I don't see why we shouldn't
> do what you just suggested.
Thanks, I'll go write up a Changelog or something and stick it in
locking/urgent.
next prev parent reply other threads:[~2026-09-15 11:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 15:27 Jann Horn
2026-09-11 8:36 ` Peter Zijlstra
2026-09-11 9:04 ` Peter Zijlstra
2026-09-11 11:51 ` Thomas Gleixner
2026-09-11 15:28 ` Jann Horn
2026-09-11 17:51 ` Davidlohr Bueso
2026-09-15 11:06 ` Sebastian Andrzej Siewior
2026-09-15 11:37 ` Peter Zijlstra [this message]
2026-09-11 15:31 ` Jann Horn
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=20260915113734.GA2009045@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=andrealmeid@igalia.com \
--cc=bigeasy@linutronix.de \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=imv4bel@gmail.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@kernel.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: 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
all inboxes | Powered by JetHome®