Re: [PATCH v2 1/1] mm/huge_memory: simplify pgtable deposit detection

From: Lance Yang

Date: Thu Sep 17 2026 - 23:22:59 EST



On Thu, Sep 17, 2026 at 04:13:59PM -0700, Andrew Morton wrote:
>On Thu, 17 Sep 2026 13:40:15 +0800 Lance Yang <lance.yang@xxxxxxxxx> wrote:
>
>> Whether a PMD has a deposited PTE page table only depends on whether the
>> architecture requires deposits or the VMA is anonymous.
>>
>> Implement this rule directly in vma_has_deposited_pgtable(), avoiding
>> mistaking a non-anonymous raw PFN PMD for one with a deposit and attempting
>> to withdraw a page table that was never deposited.
>
>A large part of my life is asking $LLM "what are the userspace-visible
>runtime effects of this bug". Because NOBODY EVER TELLS ME!!!

That's on me ... I trimmed too much from v1.

>This time it says "Processes using PMD-sized raw PFN mappings can
>trigger a kernel NULL-pointer dereference when the mapping is torn
>down", which sounds kinda important if true.

There is no known in-tree workload that triggers it, though. Mostly a
defensive/simplifying change.

>Help me out here?
>
>Also, thanks ;)

Thanks!