[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAVpQUBkFxS6Dm28n7uDoO+x63npwZWb925+Gs3UHz-gAZo7yQ@mail.gmail.com>
Date: Thu, 6 Nov 2025 14:37:10 -0800
From: Kuniyuki Iwashima <kuniyu@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: syzbot+cif2d6d318f7e85f0b@...kaller.appspotmail.com, davem@...emloft.net,
edumazet@...gle.com, hoang.h.le@...tech.com.au, horms@...nel.org,
jmaloy@...hat.com, kuni1840@...il.com, netdev@...r.kernel.org,
pabeni@...hat.com, syzbot@...ts.linux.dev, syzbot@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com, tipc-discussion@...ts.sourceforge.net
Subject: Re: [syzbot ci] Re: tipc: Fix use-after-free in tipc_mon_reinit_self().
On Thu, Nov 6, 2025 at 2:30 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Thu, 6 Nov 2025 17:59:17 +0000 Kuniyuki Iwashima wrote:
> > -void tipc_mon_reinit_self(struct net *net)
> > +void tipc_mon_reinit_self(struct net *net, bool rtnl_held)
> > {
> > struct tipc_monitor *mon;
> > int bearer_id;
> >
> > - rtnl_lock();
> > + if (!rtnl_held)
> > + rtnl_lock();
>
> I haven't looked closely but for the record conditional locking
> is generally considered to be poor code design. Extract the body
> into a __tipc_mon_reinit_self() helper and call that when lock
> is already held? And:
>
> void tipc_mon_reinit_self(struct net *net)
> {
> rtnl_lock();
> __tipc_mon_reinit_self(net);
> rtnl_unlock();
> }
That's much cleaner, I'll use this.
Thanks, Jakub!
Powered by blists - more mailing lists