[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241128080811.GC10998@redhat.com>
Date: Thu, 28 Nov 2024 09:08:11 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Zhen Ni <zhen.ni@...ystack.cn>, viro@...iv.linux.org.uk,
catalin.marinas@....com, brauner@...nel.org, zev@...ilderbeest.net,
linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org
Subject: Re: [PATCH] kernel/sys: Optimize do_prlimit lock scope to reduce
contention
On 11/28, Oleg Nesterov wrote:
>
> On 11/28, Oleg Nesterov wrote:
> >
> > The problem is that task_lock(tsk->group_leader) doesn't look right with or
> > without this patch. I'll try to make a fix on weekend.
> >
> > If the caller is sys_prlimit64() and tsk != current, then ->group_leader is
> > not stable, do_prlimit() can race with mt exec and take the wrong lock.
>
> ... and task_unlock(tsk->group_leader) is simply unsafe.
>
> perhaps something like below,
No, this is wrong too,
> I'll try to think more.
Yes...
Oleg.
Powered by blists - more mailing lists