Re: [PATCH 1/2] pid_namespace: allow opening pid_for_children before init was created
From: Oleg Nesterov
Date: Sun Feb 22 2026 - 11:55:26 EST
On 02/22, Oleg Nesterov wrote:
>
> Pavel,
>
> Your patch doesn't apply to Linus's tree.
>
> and in any case... can you avoid read_lock(tasklist) in alloc_pid() ?
> This is really not good.
I'm afraid I am totally confused, but it looks unnecessary.
Once ->child_reaper is set, it can be changed but not cleared.
This means that pidns_for_children_get() doesn't need tasklist too.
However. With or without this patch, we probably need WRITE_ONCE()
in find_child_reaper() and copy_process() + READ_ONCE() in alloc_pid()
to avoid the possible warnings from KCSAN.
No?
Oleg.