On 2/22/26 16:38, Oleg Nesterov wrote:
> Pavel,
>
> Your patch doesn't apply to Linus's tree.
Oh, sorry, for some reason I based it on top of v6.19. Will rebase, I
guess, when I figure out the second (tasklist lock) part.
>
> and in any case... can you avoid read_lock(tasklist) in alloc_pid() ?
> This is really not good.
I tried this logic with the tasklist lock to be on the safe side, it makes
sure that when a second process in the pid namespace is created, the pid
namespace is in exactly the same initialization stage as before. Moreover
the tasklist lock is already taken in the caller of alloc_pid a bit later,
so I thought it's not that bad.
I understand that taking the global lock is probably a bad idea if we can
in reality do without it. I will try to dive into the code around setting
child_reaper under tasklist lock and see if there is something which will
be not initialized enough if we check child_reaper and see it set in the
second process without lock.
Thank you for review!
>
> Oleg.
--
Best regards, Pavel Tikhomirov
Senior Software Developer, Virtuozzo.