]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc: Use barrier_nospec in copy_from_user()
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 24 Apr 2018 04:15:58 +0000 (14:15 +1000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 23 Apr 2019 15:48:54 +0000 (17:48 +0200)
commit56594a5242b89775d84a0975a81e3796d89ba647
tree7243fbb6c686e9a892c9969f92e6e1309c4b0f35
parentb6c277faab05976e5a21ff12b6549726624feec3
powerpc: Use barrier_nospec in copy_from_user()

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.

BugLink: https://bugs.launchpad.net/bugs/1822870
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit ddf35cf3764b5a182b178105f57515b42e2634f8)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/include/asm/uaccess.h