Re: [PATCH] mm: pull writability check to follow_pfnmap_start()

From: David Hildenbrand (Arm)

Date: Tue Aug 04 2026 - 05:32:17 EST


On 8/4/26 10:24, Paolo Bonzini wrote:
> On Mon, Aug 3, 2026 at 10:55 AM David Hildenbrand (Arm)
> <david@xxxxxxxxxx> wrote:
>>> index 485df9c2dbdd..34c79b5fcb9b 100644
>>> --- a/include/linux/mm.h
>>> +++ b/include/linux/mm.h
>>> @@ -3136,9 +3136,12 @@ struct follow_pfnmap_args {
>>> * Inputs:
>>> * @vma: Pointer to @vm_area_struct struct
>>> * @address: the virtual address to walk
>>> + * @write_fault: if true, fail with -EFAULT unless the mapping is
>>
>> Just wondering whether EPERM would be better.
>
> I considered EACCES, but EFAULT seems more appropriate: it's already
> what most callers return, and vm_fault_to_errno() never returns
> EACCES.

EACCES is what I actually wanted to say :)

EFAULT works for me, right now it's a clear indication for insufficient permissions.

--
Cheers,

David