sh: sanitize the flags on sigreturn
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 6 Mar 2023 01:20:30 +0000 (01:20 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 9 Mar 2023 18:01:59 +0000 (10:01 -0800)
commit573b22ccb7ce9ab7f0539a2e11a9d3609a8783f5
tree480cccbd7ade3dbf849ba6873e6b2722ac456e30
parent6a98c9cae232800c319ed69e1063480d31430887
sh: sanitize the flags on sigreturn

We fetch %SR value from sigframe; it might have been modified by signal
handler, so we can't trust it with any bits that are not modifiable in
user mode.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Rich Felker <dalias@libc.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/sh/include/asm/processor_32.h
arch/sh/kernel/signal_32.c