]> 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)
commit104a41cf2f494810356b0937d8fc1c38e9d5461a
tree169c7e5685c39b99cb96d4bf1119f8db51236e9d
parent07017385bb77995fbe123e92cef7ee8fc7bd7ce6
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