All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+b668da2bc4cb9670bf58@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [net?] possible deadlock in team_device_event (3)
Date: Wed, 31 Jul 2024 05:18:32 -0700	[thread overview]
Message-ID: <000000000000b2f64b061e8a1701@google.com> (raw)
In-Reply-To: <0000000000004da3b0061808451e@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Re: [syzbot] [net?] possible deadlock in team_device_event (3)
Author: aha310510@gmail.com

#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master 

---
 drivers/net/team/team_core.c | 5 ++++-
 include/linux/if_team.h      | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index ab1935a4aa2c..963c8311694f 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -1621,6 +1621,7 @@ static int team_init(struct net_device *dev)
 	team->dev = dev;
 	team_set_no_mode(team);
 	team->notifier_ctx = false;
+	team->nested_depth = 1;
 
 	team->pcpu_stats = netdev_alloc_pcpu_stats(struct team_pcpu_stats);
 	if (!team->pcpu_stats)
@@ -2947,8 +2948,10 @@ static void team_port_change_check(struct team_port *port, bool linkup)
 {
 	struct team *team = port->team;
 
-	mutex_lock(&team->lock);
+	mutex_lock_nested(&team->lock, team->nested_depth);
+	team->nested_depth++;
 	__team_port_change_check(port, linkup);
+	team->nested_depth--;
 	mutex_unlock(&team->lock);
 }
 
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index cdc684e04a2f..f8b4e3ed4b44 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -225,6 +225,7 @@ struct team {
 	} mcast_rejoin;
 	struct lock_class_key team_lock_key;
 	long mode_priv[TEAM_MODE_PRIV_LONGS];
+	unsigned int nested_depth;
 };
 
 static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
--

  parent reply	other threads:[~2024-07-31 12:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 16:54 [syzbot] [net?] possible deadlock in team_device_event (3) syzbot
2024-07-26 18:36 ` syzbot
2024-07-30 11:23 ` [syzbot] " syzbot
2024-07-30 12:02 ` syzbot
2024-07-30 12:41 ` syzbot
2024-07-31 12:18 ` syzbot [this message]
2024-07-31 13:20 ` syzbot
2024-07-31 14:16 ` syzbot
2024-08-01  9:57 ` syzbot
2024-08-02 14:20 ` syzbot
2025-06-27 13:23 ` Tetsuo Handa
2025-06-27 13:43   ` syzbot
2025-06-27 13:47     ` Tetsuo Handa

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=000000000000b2f64b061e8a1701@google.com \
    --to=syzbot+b668da2bc4cb9670bf58@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.