[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJ0BMu3jDOmQCkiiOe_1Fc7bZuj-p7CZcL5RC53=-MDFQ@mail.gmail.com>
Date: Fri, 3 Jan 2025 09:41:20 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Antoine Tenart <atenart@...nel.org>, davem@...emloft.net, pabeni@...hat.com,
netdev@...r.kernel.org, gregkh@...uxfoundation.org, mhocko@...e.com,
stephen@...workplumber.org
Subject: Re: [RFC PATCH net-next 1/4] net-sysfs: remove rtnl_trylock from
device attributes
On Thu, Jan 2, 2025 at 11:36 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Wed, 18 Oct 2023 17:47:43 +0200 Antoine Tenart wrote:
> > We have an ABBA deadlock between net device unregistration and sysfs
> > files being accessed[1][2]. To prevent this from happening all paths
> > taking the rtnl lock after the sysfs one (actually kn->active refcount)
> > use rtnl_trylock and return early (using restart_syscall)[3] which can
> > make syscalls to spin for a long time when there is contention on the
> > rtnl lock[4].
>
> Hi Antoine!
>
> I was looking at the sysfs locking, and ended up going down a very
> similar path. Luckily lore search for sysfs_break_active_protection()
> surfaced this thread so I can save myself some duplicated work :)
>
> Is there any particular reason why you haven't pursued this solution
> further? I think it should work.
>
> My version, FWIW:
> https://github.com/kuba-moo/linux/commit/2724bb7275496a254b001fe06fe20ccc5addc9d2
Indeed, this would probably remove a lot of syzbot reports.
Powered by blists - more mailing lists