[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGudoHFbsMxEfaNny3xWv=pd-y62fPunSjHc+6_3TVa2hdixYw@mail.gmail.com>
Date: Mon, 15 Sep 2025 15:19:24 +0200
From: Mateusz Guzik <mjguzik@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Christian Brauner <brauner@...nel.org>,
Jiri Slaby <jirislaby@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] fix the racy usage of task_lock(tsk->group_leader) in
sys_prlimit64() paths
On Mon, Sep 15, 2025 at 2:07 PM Oleg Nesterov <oleg@...hat.com> wrote:
>
> On 09/14, Mateusz Guzik wrote:
> > As for something more longterm, what would you think about
> > synchronizing changes with a lock within ->signal?
>
> Agreed, we should probably change the locking, but I am not a new lock
> to protect just signal->rlim makes a lot of sense...
>
> We can probably reuse signal->stats_lock, but it needs to disable IRQs.
> Or ->siglock, but it is already overused.
>
The woes from a lock from a different structure aside, I find it
pretty weird that reading rlimits requires taking a lock to begin
with.
I'm not going to argue for a new dedicated lock. I do argue for
sequence counters to read this. With this in place even the
irq-shafted lock wont be much of a problem.
Again I can write a patch to that extent, but no ETA.
> I dunno. In any case we need to cleanup the usage of ->group_leader,
> it seems there are more buggy users. I'll try to take another look
> this week. And probably it and ->real_parent should be moved to
> signal_struct.
>
I got myself into some vfs-related stuff, so I'm going to spare a rant
about linux not having a 'struct process' or similar. ;->
Powered by blists - more mailing lists