summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2022-07-11 18:16:25 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2022-07-11 09:52:59 -0700
commitd5b36a4dbd06c5e8e36ca8ccc552f679069e2946 (patch)
tree9c6f81aabf791e0e6bccf60d3882257374cd75f2 /fs
parent32346491ddf24599decca06190ebca03ff9de7f8 (diff)
downloadlinux-d5b36a4dbd06c5e8e36ca8ccc552f679069e2946.tar.gz
linux-d5b36a4dbd06c5e8e36ca8ccc552f679069e2946.tar.xz
fix race between exit_itimers() and /proc/pid/timers
As Chris explains, the comment above exit_itimers() is not correct, we can race with proc_timers_seq_ops. Change exit_itimers() to clear signal->posix_timers with ->siglock held. Cc: <stable@vger.kernel.org> Reported-by: chris@accessvector.net Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 0989fb8472a1..778123259e42 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1301,7 +1301,7 @@ int begin_new_exec(struct linux_binprm * bprm)
bprm->mm = NULL;
#ifdef CONFIG_POSIX_TIMERS
- exit_itimers(me->signal);
+ exit_itimers(me);
flush_itimer_signals();
#endif