powerpc/32s: Drop NULL addr verification
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 24 Jan 2020 11:54:42 +0000 (11:54 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 28 Jan 2020 12:13:54 +0000 (23:13 +1100)
commit88f8c080d47f307871840a0a825ef556673eb592
tree169c7e5685c39b99cb96d4bf1119f8db51236e9d
parent1d8f739b07bd538f272f60bf53f10e7e6248d295
powerpc/32s: Drop NULL addr verification

NULL addr is a user address. Don't waste time checking it. If
someone tries to access it, it will SIGFAULT the same way as for
address 1, so no need to make it special.

The special case is when not doing a write, in that case we want
to drop the entire function. This is now handled by 'dir' param
and not by the nulity of 'to' anymore.

Also make beginning of prevent_user_access() similar
to beginning of allow_user_access(), and tell the compiler
that writing in kernel space or with a 0 length is unlikely

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/85e971223dfe6ace734637db1841678939a76155.1579866752.git.christophe.leroy@c-s.fr
arch/powerpc/include/asm/book3s/32/kup.h