Re: [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes

From: Oscar Salvador (SUSE)

Date: Mon Nov 30 2026 - 14:08:47 EST


On Tue, Nov 24, 2026 at 10:15:21PM -0800, 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.
>
> 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.
>
> Fixes: 8382d914ebf7 ("mm, hugetlb: improve page-fault scalability")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Zhengchuan Liang <zcliangcn@xxxxxxxxx>

With the "const" fix, you can add:

Acked-by: Oscar Salvador (SUSE) <osalvador@xxxxxxxxxx



--
Oscar Salvador
SUSE Labs