lkml.org 
[lkml]   [2021]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] futex: Fix fault_in_user_writeable()
Date
On Tue, Aug 17 2021 at 09:53, Huacai Chen wrote:
> On Tue, Aug 17, 2021 at 3:03 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>> That's surely one way to fix that. If that does not work for whatever
>> reason, then we really don't want this find_vma() hack there, but rather
>> something like:
> I don't know why find_vma() is unacceptable here, there is also
> find_vma() in fixup_user_fault().

Wrong. find_extend_vma() != find_vma(). Aside of that fixup_user_fault()
does way more than that.

>> if (IS_ENABLED(CONFIG_ARCH_USER_FAULT_VOODOO) && get_user(&tmp, uaddr))
>> return -EFAULT;
>
> get_user() may be better than find_vma(), but can we drop
> CONFIG_ARCH_USER_FAULT_VOODOO here? On those "W implies R" archs,
> get_user() always success, this can simplify the logic.

For architectures which imply R fixup_user_fault() is way more
effinicient than taking the fault on get_user() and then invoking
fixup_user_fault() to ensure that the mapping is writeable.

No, we are not making stuff less efficient just because of MIPS.

Thanks,

tglx

\
 
 \ /
  Last update: 2021-08-17 09:09    [W:0.085 / U:1.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site