# Re: \[PATCH v17\] exec: Fix dead-lock in de\_thread with ptrace\_attach

- From: Oleg Nesterov \<oleg@redhat.com\>
- Date: 2025-11-02 16:22:11 
- List: linux-security-module
- Page: https://ratatoskr.run/linux-security-module/2025/11/329633
- Thread: https://ratatoskr.run/linux-fsdevel/2021/06/208114/t.md

```text
On 08/21, Bernd Edlinger wrote:
>
> v16: rebased to 6.17-rc2, fixed some minor merge conflicts.
>
> v17: avoid use of task->in_execve in ptrace_attach.

So I guess this version doesn't really differ from v14 I tried to review...
(yes, iirc my review wasn't really good, sorry).

Perhaps I am wrong, but I still think we need another approach. de_thread()
should not wait until all sub-threads are reaped, it should drop cred_guard_mutex
earlier.

I mean, something like

	[PATCH V2 1/2] exec: don't wait for zombie threads with cred_guard_mutex held
	https://lore.kernel.org/lkml/20170213180454.GA2858@redhat.com/

which is hopelessly outdated now.

Again, perhaps I am wrong. I'll try to take another look next week.

Oleg.

```
