summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-10-09 16:01:59 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-10-09 16:01:59 -0700
commitc71370bde7dbd3aefae0c2e8dd643d68fb2c51c8 (patch)
tree448d1b2cc5595324528280ed35505372b79cddf6
parent4899a36f91a9f9b06878471096bd143e7253006d (diff)
parenta7c01fa93aeb03ab76cd3cb2107990dd160498e6 (diff)
Merge tag 'interrupting_kthread_stop-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull kthread update from Eric Biederman: "Break out of wait loops on kthread_stop() This is a small tweak to kthread_stop so it breaks out of interruptible waits, that don't explicitly test for kthread_stop. These interruptible waits occassionaly occur in kernel threads do to code sharing" * tag 'interrupting_kthread_stop-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: signal: break out of wait loops on kthread_stop()
-rw-r--r--kernel/kthread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 28a6b7ab4a0f..f97fd01a2932 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -704,6 +704,7 @@ int kthread_stop(struct task_struct *k)
kthread = to_kthread(k);
set_bit(KTHREAD_SHOULD_STOP, &kthread->flags);
kthread_unpark(k);
+ set_tsk_thread_flag(k, TIF_NOTIFY_SIGNAL);
wake_up_process(k);
wait_for_completion(&kthread->exited);
ret = kthread->result;