Re: [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes
From: David Hildenbrand (Arm)
Date: Thu Nov 26 2026 - 06:17:57 EST
On 11/25/26 19:59, Zhengchuan Liang wrote:
>> 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.
>
> Thanks. To clarify the threat model, this is an exact kernel heap
> address leak.
Ah, sorry. I was jumping to conclusions that this is about harming other hugetlb
users.
> The attack does not target another HugeTLB user or their
> mapping. An unprivileged process creates and operates only on its own
> no-reserve HugeTLB memfd, even with an empty huge-page pool, and recovers
> the exact address of its embedded address_space.
Interesting.
> Since that object has a
> fixed offset within struct hugetlbfs_inode_info, this also gives the
> exact address of the hugetlbfs_inode_cache allocation.
>
> KernelSnitch (NDSS 2025) demonstrated why the address of an
> attacker-created object can be useful. It recovered an mm_struct address,
> freed all objects in the corresponding slab, reclaimed the slab pages
> with msg_msg objects, and thereby learned the addresses of those
> replacement objects. Here an attacker can similarly allocate and release
> hugetlbfs_inode_cache objects by creating and closing HugeTLB memfds. I
> have not demonstrated full-slab reclamation or cross-cache reuse for this
> case.
Right. Do we have any gut feeling how exploitable this is?
>
> https://www.ndss-symposium.org/ndss-paper/kernelsnitch-side-channel-attacks-on-kernel-data-structures/
>
>> Can't we still end up with the same problem, just slightly different,
>> afterwards?
>
> Yes, the timing channel may allow the per-inode seed to be recovered as
> well. That does not recreate the address disclosure: the seed is neither
> derived from a kernel address nor used anywhere else, so recovering it
> reveals only this inode's bucket distribution.
>
> A simpler fix would be to replace the mapping pointer in the existing key
> with mapping->host->i_ino. The inode number is stable for the inode's
> lifetime and is already exposed through fstat(). This would preserve
> separate per-inode distributions without adding a new field.
>
> I understand if this particular address disclosure is not considered
> worth fixing.
Oh I just have 0 experience with these types of (let's call it) address leaks. I
know that we, in general, try to not expose PFNs/pointers to user space because
of rowhammer.
So this probably should be fixed.
Using a random number looks good to me.
Just not sure about the severity.
--
Cheers,
David