Re: [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes
From: David Hildenbrand (Arm)
Date: Wed Nov 25 2026 - 06:58:47 EST
On 11/25/26 07:15, Zhengchuan Liang wrote:
> hugetlb_fault_mutex_hash() uses the address_space pointer and page index
> to select an entry in a global mutex table. An unprivileged user can
> create a no-reserve HugeTLB memfd with an empty huge page pool, build
> contention on one index, and time SIGBUS faults at chosen indices.
> Pointer-dependent mutex collisions expose equations that recover the
> exact address_space address.
I'm not sure we care about this problem. I'll let other speak up.
Attacking hugetlb users is stupid. This doesn't matter in practice.
[I had stupid AI fix that allocated fault mutexes for each inode that I
discarded immediately]
>
> Give each hugetlbfs inode a dedicated random hash seed instead, and hash
> the page index with that value. Operations on the same mapping continue
> to select the same mutex, while separate mappings retain independent
> bucket distributions without encoding an address. The seed is not
> relied upon as a secret and is not reused by another hash table.
Can't we still end up with the same problem, just slightly different, afterwards?
--
Cheers,
David