summaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
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 18:52:59 +0200
commitd5b36a4dbd06c5e8e36ca8ccc552f679069e2946 (patch)
tree9c6f81aabf791e0e6bccf60d3882257374cd75f2 /kernel/exit.c
parentLinux 5.19-rc6 (diff)
downloadlinux-d5b36a4dbd06c5e8e36ca8ccc552f679069e2946.tar.xz
linux-d5b36a4dbd06c5e8e36ca8ccc552f679069e2946.zip
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 'kernel/exit.c')
-rw-r--r--kernel/exit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index f072959fcab7..64c938ce36fe 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -766,7 +766,7 @@ void __noreturn do_exit(long code)
#ifdef CONFIG_POSIX_TIMERS
hrtimer_cancel(&tsk->signal->real_timer);
- exit_itimers(tsk->signal);
+ exit_itimers(tsk);
#endif
if (tsk->mm)
setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm);