exec: Copy oldsighand->action under spin-lock
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 7 Jun 2021 13:54:27 +0000 (15:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:59:12 +0000 (23:59 +0900)
commit46b4b1e11e52fb2224bea17b61c4a672c574b423
tree08eb0d101caf0da5dceab642987b560a316db818
parent265b6fb780f57d10449a40e94219b28fa52479cc
exec: Copy oldsighand->action under spin-lock

commit 5bf2fedca8f59379025b0d52f917b9ddb9bfe17e upstream.

unshare_sighand should only access oldsighand->action
while holding oldsighand->siglock, to make sure that
newsighand->action is in a consistent state.

Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: stable@vger.kernel.org
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/AM8PR10MB470871DEBD1DED081F9CC391E4389@AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/exec.c