* + exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9.patch added to -mm tree
@ 2021-06-11 23:16 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-06-11 23:16 UTC (permalink / raw)
To: adobriyan, areber, axboe, bernd.edlinger, chaithco,
christian.brauner, deller, ebiederm, jamorris, keescook,
laoar.shao, luto, mhocko, mm-commits, oleg, serge, shuah, surenb,
tglx, viro, wad, yifeifz2
The patch titled
Subject: exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9
has been added to the -mm tree. Its filename is
exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
Subject: exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9
Link: https://lkml.kernel.org/r/AM8PR10MB470896FBC519ABCC20486958E4349@AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM
Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Will Drewry <wad@chromium.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: James Morris <jamorris@linux.microsoft.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Charles Haithcock <chaithco@redhat.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Yafang Shao <laoar.shao@gmail.com>
Cc: Helge Deller <deller@gmx.de>
Cc: YiFei Zhu <yifeifz2@illinois.edu>
Cc: Adrian Reber <areber@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/exec.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
--- a/fs/exec.c~exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9
+++ a/fs/exec.c
@@ -1056,29 +1056,31 @@ static int de_thread(struct task_struct
return -EAGAIN;
}
- while_each_thread(tsk, t) {
- if (unlikely(t->ptrace) && t != tsk->group_leader)
- sig->unsafe_execve_in_progress = true;
- }
-
sig->group_exit_task = tsk;
sig->notify_count = zap_other_threads(tsk);
if (!thread_group_leader(tsk))
sig->notify_count--;
- spin_unlock_irq(lock);
- if (unlikely(sig->unsafe_execve_in_progress))
+ while_each_thread(tsk, t) {
+ if (unlikely(t->ptrace) && t != tsk->group_leader)
+ sig->unsafe_execve_in_progress = true;
+ }
+
+ if (unlikely(sig->unsafe_execve_in_progress)) {
+ spin_unlock_irq(lock);
mutex_unlock(&sig->cred_guard_mutex);
+ spin_lock_irq(lock);
+ }
- for (;;) {
- set_current_state(TASK_KILLABLE);
- if (!sig->notify_count)
- break;
+ while (sig->notify_count) {
+ __set_current_state(TASK_KILLABLE);
+ spin_unlock_irq(lock);
schedule();
if (__fatal_signal_pending(tsk))
goto killed;
+ spin_lock_irq(lock);
}
- __set_current_state(TASK_RUNNING);
+ spin_unlock_irq(lock);
if (unlikely(sig->unsafe_execve_in_progress)) {
if (mutex_lock_killable(&sig->cred_guard_mutex))
_
Patches currently in -mm which might be from bernd.edlinger@hotmail.de are
exec-fix-dead-lock-in-de_thread-with-ptrace_attach.patch
exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-11 23:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 23:16 + exec-fix-dead-lock-in-de_thread-with-ptrace_attach-v9.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.