]> git.baikalelectronics.ru Git - kernel.git/commit
sh: sanitize the flags on sigreturn
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 6 Mar 2023 01:20:30 +0000 (01:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:40 +0000 (11:16 +0200)
commita7d0c43b23ffb3f8033c199841ffd5b0011302e1
tree0c58a2658d94b38ef32adbc9601dfd20ea01d919
parent0df7338ea3428852c18c3fe1f39f06343a61143f
sh: sanitize the flags on sigreturn

[ Upstream commit 573b22ccb7ce9ab7f0539a2e11a9d3609a8783f5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/sh/include/asm/processor_32.h
arch/sh/kernel/signal_32.c