]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit8a91e5eca44b1c48a63d5e82bebc96ee52ee4464
tree169c7e5685c39b99cb96d4bf1119f8db51236e9d
parentc76d6e5a92c2c5c98c1eaab1c4787c09e0b3ff05
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