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

"David Hildenbrand (Arm)" <[email protected]> Tue, 4 Aug 2026 11:22:40 +0200
Newsgroups gmane.linux.kernel,gmane.comp.emulators.kvm.devel,gmane.linux.kernel.mm
Message-ID <[email protected]>
On 8/4/26 10:24, Paolo Bonzini wrote:
> On Mon, Aug 3, 2026 at 10:55 AM David Hildenbrand (Arm)
> <[email protected]> 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