fix race between exit_itimers() and /proc/pid/timers
authorOleg Nesterov <oleg@redhat.com>
Mon, 11 Jul 2022 16:16:25 +0000 (18:16 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 11 Jul 2022 16:52:59 +0000 (09:52 -0700)
commitd5b36a4dbd06c5e8e36ca8ccc552f679069e2946
tree9c6f81aabf791e0e6bccf60d3882257374cd75f2
parent32346491ddf24599decca06190ebca03ff9de7f8
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>
fs/exec.c
include/linux/sched/task.h
kernel/exit.c
kernel/time/posix-timers.c