]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc: Implement user_access_begin and friends
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 19 Nov 2020 23:42:00 +0000 (10:42 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Nov 2020 09:02:25 +0000 (10:02 +0100)
commit8145b3a014e8504f02e15a38f04051fec826f4f2
tree62d8e32bf1dc7eeea76ceee269eaede8839f603c
parent357a5e6febe8839bd217121baa394b11e8fe4085
powerpc: Implement user_access_begin and friends

commit 5cd623333e7cf4e3a334c70529268b65f2a6c2c7 upstream.

Today, when a function like strncpy_from_user() is called,
the userspace access protection is de-activated and re-activated
for every word read.

By implementing user_access_begin and friends, the protection
is de-activated at the beginning of the copy and re-activated at the
end.

Implement user_access_begin(), user_access_end() and
unsafe_get_user(), unsafe_put_user() and unsafe_copy_to_user()

For the time being, we keep user_access_save() and
user_access_restore() as nops.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/36d4fbf9e56a75994aca4ee2214c77b26a5a8d35.1579866752.git.christophe.leroy@c-s.fr
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/uaccess.h