From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Zhengchuan Liang <zcliangcn@gmail.com>
Cc: Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Davidlohr Bueso <davidlohr@hp.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes
Date: Thu, 26 Nov 2026 12:17:23 +0100 [thread overview]
Message-ID: <3ee0f274-0089-4450-9888-7be659af9d63@kernel.org> (raw)
In-Reply-To: <CAOny8psx408zqVv1xt7DHN8yYkQksjKZFDQCJ+AGFB-CDN9SmA@mail.gmail.com>
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
next prev parent reply other threads:[~2026-11-26 11:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 6:15 [PATCH] mm/hugetlb: stop hashing address_space pointers for fault mutexes Zhengchuan Liang
2026-11-25 11:58 ` David Hildenbrand (Arm)
2026-11-25 18:59 ` Zhengchuan Liang
2026-11-26 11:17 ` David Hildenbrand (Arm) [this message]
2026-11-26 11:20 ` David Hildenbrand (Arm)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ee0f274-0089-4450-9888-7be659af9d63@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=davidlohr@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=zcliangcn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox