ARM: BUG if jumping to usermode address in kernel mode

commit 8bafae202c upstream.

Detect if we are returning to usermode via the normal kernel exit paths
but the saved PSR value indicates that we are in kernel mode.  This
could occur due to corrupted stack state, which has been observed with
"ftracetest".

This ensures that we catch the problem case before we get to user code.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Alex Shi <alex.shi@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Russell King 2017-11-24 23:49:34 +00:00 • committed by Greg Kroah-Hartman
commit 21e1e6192b
2 changed files with 24 additions and 0 deletions