netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: syzbot+cif2d6d318f7e85f0b@syzkaller.appspotmail.com,
	davem@davemloft.net, edumazet@google.com,
	hoang.h.le@dektech.com.au, horms@kernel.org, jmaloy@redhat.com,
	kuni1840@gmail.com, netdev@vger.kernel.org, pabeni@redhat.com,
	syzbot@lists.linux.dev, syzbot@syzkaller.appspotmail.com,
	syzkaller-bugs@googlegroups.com,
	tipc-discussion@lists.sourceforge.net
Subject: Re: [syzbot ci] Re: tipc: Fix use-after-free in tipc_mon_reinit_self().
Date: Thu, 6 Nov 2025 14:30:04 -0800	[thread overview]
Message-ID: <20251106143004.55f4f3fc@kernel.org> (raw)
In-Reply-To: <20251106175926.686885-1-kuniyu@google.com>

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();
}

  reply	other threads:[~2025-11-06 22:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  5:32 [PATCH v1 net] tipc: Fix use-after-free in tipc_mon_reinit_self() Kuniyuki Iwashima
2025-11-06  9:38 ` [syzbot ci] " syzbot ci
2025-11-06 17:59   ` Kuniyuki Iwashima
2025-11-06 22:30     ` Jakub Kicinski [this message]
2025-11-06 22:37       ` Kuniyuki Iwashima
2025-11-06 22:39         ` Jakub Kicinski
2025-11-06 22:51           ` Kuniyuki Iwashima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251106143004.55f4f3fc@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hoang.h.le@dektech.com.au \
    --cc=horms@kernel.org \
    --cc=jmaloy@redhat.com \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+cif2d6d318f7e85f0b@syzkaller.appspotmail.com \
    --cc=syzbot@lists.linux.dev \
    --cc=syzbot@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).