mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+b8c48ea38ca27d150063@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] WARNING in __linkwatch_sync_dev (2)
Date: Sun,  3 Aug 2025 07:09:39 +0800	[thread overview]
Message-ID: <20250802230940.3712-1-hdanton@sina.com> (raw)
In-Reply-To: <684c8a60.050a0220.be214.02a6.GAE@google.com>

> Date: Fri, 1 Jun 2025 13:30:24 -0700	[thread overview]
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    27605c8c0f69 Merge tag 'net-6.16-rc2' of git://git.kernel...
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=17bb9d70580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=8e5a54165d499a9
> dashboard link: https://syzkaller.appspot.com/bug?extid=b8c48ea38ca27d150063
> compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11a7b9d4580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1421310c580000

#syz test upstream master

--- x/drivers/net/bonding/bond_main.c
+++ y/drivers/net/bonding/bond_main.c
@@ -2968,7 +2968,6 @@ static void bond_mii_monitor(struct work
 {
 	struct bonding *bond = container_of(work, struct bonding,
 					    mii_work.work);
-	bool should_notify_peers = false;
 	bool commit;
 	unsigned long delay;
 	struct slave *slave;
@@ -2978,46 +2977,29 @@ static void bond_mii_monitor(struct work
 
 	if (!bond_has_slaves(bond))
 		goto re_arm;
+	/* Race avoidance with bond_close cancel of workqueue */
+	if (!rtnl_trylock()) {
+		delay = 1;
+		goto re_arm;
+	}
 
 	rcu_read_lock();
-	should_notify_peers = bond_should_notify_peers(bond);
 	commit = !!bond_miimon_inspect(bond);
-	if (bond->send_peer_notif) {
-		rcu_read_unlock();
-		if (rtnl_trylock()) {
-			bond->send_peer_notif--;
-			rtnl_unlock();
-		}
-	} else {
-		rcu_read_unlock();
-	}
+	if (bond->send_peer_notif)
+		bond->send_peer_notif--;
+	rcu_read_unlock();
 
 	if (commit) {
-		/* Race avoidance with bond_close cancel of workqueue */
-		if (!rtnl_trylock()) {
-			delay = 1;
-			should_notify_peers = false;
-			goto re_arm;
-		}
-
 		bond_for_each_slave(bond, slave, iter) {
 			bond_commit_link_state(slave, BOND_SLAVE_NOTIFY_LATER);
 		}
 		bond_miimon_commit(bond);
-
-		rtnl_unlock();	/* might sleep, hold no other locks */
 	}
+	rtnl_unlock();
 
 re_arm:
 	if (bond->params.miimon)
 		queue_delayed_work(bond->wq, &bond->mii_work, delay);
-
-	if (should_notify_peers) {
-		if (!rtnl_trylock())
-			return;
-		call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
-		rtnl_unlock();
-	}
 }
 
 static int bond_upper_dev_walk(struct net_device *upper,
--

  parent reply	other threads:[~2025-08-02 23:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12  2:21 syzbot
2025-06-13  1:09 ` Stanislav Fomichev
2025-06-13 23:56   ` Jakub Kicinski
2025-06-13 20:30 ` syzbot
2025-06-16 15:54   ` Stanislav Fomichev
2025-06-16 16:07     ` syzbot
2025-08-02 23:09   ` Hillf Danton [this message]
2025-08-02 23:28     ` syzbot
2025-08-02 15:01 ` syzbot

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=20250802230940.3712-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+b8c48ea38ca27d150063@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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

all inboxes | Powered by JetHome®