lkml.org 
[lkml]   [2021]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] futex: Fix fault_in_user_writeable()
Date
On Mon, Aug 16 2021 at 11:27, Davidlohr Bueso wrote:
> On Mon, 16 Aug 2021, Huacai Chen wrote:
>
>>fault_in_user_writeable() should verify R/W access but only verify W. In
>>most archs W implies R, but not true in MIPS and LoongArch, so fix it.
>
> Yuck for a find_vma() in futex.c. If this is a problem in MIPS, shouldn't
> the fix be there? Furthermore it's stated that fault_in_user_writeable():
>
> "Fault in user address and verify RW access"

That seems to be wishful thinking given the fact that some architectures
do not imply R for FLAG_FAULT_WRITE.

> And you guys seem to have proposed it already:
>
> https://lore.kernel.org/linux-mips/20200630005845.1239974-1-liulichao@loongson.cn/

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:

if (IS_ENABLED(CONFIG_ARCH_USER_FAULT_VOODOO) && get_user(&tmp, uaddr))
return -EFAULT;

Thanks,

tglx

\
 
 \ /
  Last update: 2021-08-16 21:03    [W:1.063 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site