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

"David Hildenbrand (Arm)" <[email protected]>
Newsgroups org.kernel.vger.linux-s390,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.