Netdev List
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jeongjun Park <aha310510@gmail.com>
Cc: edumazet@google.com, davem@davemloft.net, kuba@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com,
	syzbot+b668da2bc4cb9670bf58@syzkaller.appspotmail.com
Subject: Re: [PATCH net,v2] team: fix possible deadlock in team_port_change_check
Date: Fri, 2 Aug 2024 19:42:41 +0200	[thread overview]
Message-ID: <Zq0akdhiSeoiOLsY@nanopsycho.orion> (raw)
In-Reply-To: <20240802162531.97752-1-aha310510@gmail.com>

Fri, Aug 02, 2024 at 06:25:31PM CEST, aha310510@gmail.com wrote:
>Eric Dumazet wrote:
>>
>> On Fri, Aug 2, 2024 at 5:00 PM Jeongjun Park <aha310510@gmail.com> wrote:
>> >

[..]

>@@ -2501,6 +2470,11 @@ int team_nl_options_get_doit(struct sk_buff *skb, struct genl_info *info)
> 	int err;
> 	LIST_HEAD(sel_opt_inst_list);
> 
>+	if (!rtnl_is_locked()) {

This is completely wrong, other thread may hold the lock.


>+		rtnl_lock();

NACK! I wrote it in the other thread. Don't take rtnl for get options
command. It is used for repeated fetch of stats. It's read only. Should
be converted to RCU.

Why are you so obsessed by this hypothetical syzcaller bug? Are you
hitting this in real? If not, please let it go. I will fix it myself
when I find some spare cycles.




>+		team->rtnl_locked = true;
>+	}
>+
> 	team = team_nl_team_get(info);
> 	if (!team)
> 		return -EINVAL;
>@@ -2513,6 +2487,11 @@ int team_nl_options_get_doit(struct sk_buff *skb, struct genl_info *info)
> 
> 	team_nl_team_put(team);
> 
>+	if (team->rtnl_locked) {
>+		team->rtnl_locked = false;
>+		rtnl_unlock();
>+	}
>+
> 	return err;
> }
> 

[..]

  reply	other threads:[~2024-08-02 17:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 14:59 [PATCH net,v2] team: fix possible deadlock in team_port_change_check Jeongjun Park
2024-08-02 15:08 ` Eric Dumazet
2024-08-02 16:25   ` Jeongjun Park
2024-08-02 17:42     ` Jiri Pirko [this message]
2024-08-03  1:36       ` Jeongjun Park
2024-08-03  6:58         ` Jiri Pirko
2024-08-03 11:51           ` Jeongjun Park

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=Zq0akdhiSeoiOLsY@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=aha310510@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+b668da2bc4cb9670bf58@syzkaller.appspotmail.com \
    /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