Re: [PATCH 1/1] mm/huge_memory: disallow raw PMD mappings of the huge zero page

From: David Hildenbrand (Arm)

Date: Fri Sep 18 2026 - 16:32:15 EST


On 9/17/26 18:03, Kiryl Shutsemau wrote:
> On Thu, Sep 17, 2026 at 05:29:48PM +0200, David Hildenbrand (Arm) wrote:
>> On 9/17/26 16:32, Kiryl Shutsemau wrote:
>>>
>>> The patch looks fine, but don't we want to cover the same for non-huge
>>> zero page in vmf_insert_pfn_prot()?
>>
>> Why would the zeropage be a problem in PFNMAP mapping?
>
> Nothing enforces that it is read-only.

Well, ok, that at least would be easy to check.

There are other reasons why we'd want to disallow it ... similar to the check in
vm_mixed_ok().

Which reminds me that we should try getting rid of vmf_insert_mixed() at some
point ... but it's tricky.

--
Cheers,

David