Re: [PATCH v2] futex: Use a keyed hash for global futex buckets
From: Thomas Gleixner
Date: Thu Oct 22 2026 - 17:37:54 EST
On Mon, Oct 19 2026 at 11:33, Kyle Zeng wrote:
> The global futex hash is a public jhash2 of the key, which for private
> and shared-anonymous futexes includes an mm_struct pointer. A task can
> populate a bucket with futex_waitv() and time nonmatching wakes to learn
> which chosen user addresses collide. Shared-file keys have predictable
> inode sequence numbers, so the task can also identify the bucket and
> turn those timings into constraints on current->mm.
>
> Lukas Maar, Jonas Juffinger, Thomas Steinbauer, Daniel Gruss, and Stefan
> Mangard described this futex mm_struct disclosure in KernelSnitch at
> NDSS 2025. Section VI-B recovers the pointer by observing futex hash
> collisions and evaluating jhash2 offline.
>
> The per-mm private hash does not prevent this: a task can disable it
> through PR_FUTEX_HASH. NUMA-routed private futexes and shared-anonymous
> keys also use the global hash.
>
> Use SipHash-2-4 with a boot-time random key for global bucket selection.
> Hash the three identity fields individually, without padding or the
> separately handled NUMA node. Keep the original futex keys and equality
> checks, and leave the per-mm hash, which only hashes userspace addresses
> and offsets, unchanged. Initialize the secret before the global tables
> are made available and keep it fixed for their lifetime.
Fine. Did you evaluate the performance impact of this change?