Re: [tip: locking/urgent] futex: Allow to resize the private local hash
From: Peter Zijlstra
Date: Wed Jun 11 2025 - 11:14:11 EST
On Wed, Jun 11, 2025 at 04:43:02PM +0200, Sebastian Andrzej Siewior wrote:
> On 2025-06-11 14:39:16 [-0000], tip-bot2 for Sebastian Andrzej Siewior wrote:
> > The following commit has been merged into the locking/urgent branch of tip:
> >
> > Commit-ID: 703b5f31aee5bda47868c09a3522a78823c1bb77
> > Gitweb: https://git.kernel.org/tip/703b5f31aee5bda47868c09a3522a78823c1bb77
> > Author: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> > AuthorDate: Mon, 02 Jun 2025 13:00:27 +02:00
> > Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > CommitterDate: Wed, 11 Jun 2025 16:26:44 +02:00
> >
> > futex: Allow to resize the private local hash
> >
> > Once the global hash is requested there is no way back to switch back to
> > the per-task private hash. This is checked at the begin of the function.
> >
> > It is possible that two threads simultaneously request the global hash
> > and both pass the initial check and block later on the
> > mm::futex_hash_lock. In this case the first thread performs the switch
> > to the global hash. The second thread will also attempt to switch to the
> > global hash and while doing so, accessing the nonexisting slot 1 of the
> > struct futex_private_hash.
> > This has been reported by Yi Lai.
> >
> > Verify under mm_struct::futex_phash that the global hash is not in use.
>
> Could you please replace it with
> https://lore.kernel.org/all/20250610104400.1077266-5-bigeasy@xxxxxxxxxxxxx/
>
> It also looks like the subject from commit bd54df5ea7cad ("futex: Allow
> to resize the private local hash")
Now done so, unless I messed up again :/