]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc: Use barrier_nospec in copy_from_user()
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 29 Mar 2019 11:25:52 +0000 (22:25 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:25:12 +0000 (06:25 +0200)
commit3692ca6ff3ee470951c91c788447ed38e6f8dd7c
tree0ef84d6f2c322df691532f8c9aece4eb0459d1f3
parentae082ed4702e31ed833b7b40b1afe4ce11adb6b4
powerpc: Use barrier_nospec in copy_from_user()

commit ddf35cf3764b5a182b178105f57515b42e2634f8 upstream.

Based on the x86 commit doing the same.

See commit 304ec1b05031 ("x86/uaccess: Use __uaccess_begin_nospec()
and uaccess_try_nospec") and b3bbfb3fb5d2 ("x86: Introduce
__uaccess_begin_nospec() and uaccess_try_nospec") for more detail.

In all cases we are ordering the load from the potentially
user-controlled pointer vs a previous branch based on an access_ok()
check or similar.

Base on a patch from Michal Suchanek.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/uaccess.h