Re: [PATCH 3/8] mm: Return the address from page_mapped_in_vma()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2024/3/6 4:09, Matthew Wilcox wrote:
> On Mon, Mar 04, 2024 at 08:31:56PM +0800, Miaohe Lin wrote:
>> On 2024/3/1 5:20, Matthew Wilcox (Oracle) wrote:
>>> The only user of this function calls page_address_in_vma() immediately
>>> after page_mapped_in_vma() calculates it and uses it to return true/false.
>>> Return the address instead, allowing memory-failure to skip the call
>>> to page_address_in_vma().
>>
>> IIUC, this patch will change the semantic slightly. There is one corner
>> case where page_mapped_in_vma() returns true but page_address_in_vma()
>> returns -EFAULT if mremap is done after the check. In that case,
>> SIGKILL will be sent to the user. But with this patch applied, SIGBUS
>> will be sent to the user with address before doing mremap. Or am I
>> miss something?
> 
> Isn't that an example of a race that userspace can't possibly rely on?

You're right. Userspace shouldn't possibly rely on it.
Thanks.

> It can't observe where the kernel has got to in its processing of the
> fault, so it's OK if we behave if the mremap() has happened before,
> during or after the two calls.
> .
> 





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux