powerpc/32: Warn and return ENOSYS on syscalls from kernel
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 31 Jan 2020 11:34:54 +0000 (11:34 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 19 Feb 2020 11:46:08 +0000 (22:46 +1100)
commit9e27086292aa880921a0f2b8501e5189d5efcf03
tree79b9c6c21074e5da094dce9cf912ad3b7bd313b3
parent030e347430957f6f7f29db9099368f8b86c0bf76
powerpc/32: Warn and return ENOSYS on syscalls from kernel

Since commit b86fb88855ea ("powerpc/32: implement fast entry for
syscalls on non BOOKE") and commit 1a4b739bbb4f ("powerpc/32:
implement fast entry for syscalls on BOOKE"), syscalls from
kernel are unexpected and can have catastrophic consequences
as it will destroy the kernel stack.

Test MSR_PR on syscall entry. In case syscall is from kernel,
emit a warning and return ENOSYS error.

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/8ee3bdbbdfdfc64ca7001e90c43b2aee6f333578.1580470482.git.christophe.leroy@c-s.fr
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/head_32.h
arch/powerpc/kernel/head_booke.h