summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-08-13 23:38:22 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2022-08-13 23:38:22 +0200
commitf6eb0fed6a3957c0b93e3a00c1ffaad84d4ffc31 (patch)
tree9728d3ce3dfee85b12648f5665ca76c07b763623 /fs
parentMerge tag 'x86-urgent-2022-08-13' of git://git.kernel.org/pub/scm/linux/kerne... (diff)
parentposix-cpu-timers: Cleanup CPU timers before freeing them during exec (diff)
downloadlinux-f6eb0fed6a3957c0b93e3a00c1ffaad84d4ffc31.tar.xz
linux-f6eb0fed6a3957c0b93e3a00c1ffaad84d4ffc31.zip
Merge tag 'timers-urgent-2022-08-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Ingo Molnar: "Misc timer fixes: - fix a potential use-after-free bug in posix timers - correct a prototype - address a build warning" * tag 'timers-urgent-2022-08-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: posix-cpu-timers: Cleanup CPU timers before freeing them during exec time: Correct the prototype of ns_to_kernel_old_timeval and ns_to_timespec64 posix-timers: Make do_clock_gettime() static
Diffstat (limited to 'fs')
-rw-r--r--fs/exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 5fd73915c62c..f793221f4eb6 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1304,6 +1304,9 @@ int begin_new_exec(struct linux_binprm * bprm)
bprm->mm = NULL;
#ifdef CONFIG_POSIX_TIMERS
+ spin_lock_irq(&me->sighand->siglock);
+ posix_cpu_timers_exit(me);
+ spin_unlock_irq(&me->sighand->siglock);
exit_itimers(me);
flush_itimer_signals();
#endif