All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Jay Vosburgh <jv@jvosburgh.net>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch,
	sdf@fomichev.me, liuhangbin@gmail.com,
	linux-kernel@vger.kernel.org,
	syzbot+b8c48ea38ca27d150063@syzkaller.appspotmail.com
Subject: Re: [PATCH net] bonding: switch bond_miimon_inspect to rtnl lock
Date: Mon, 16 Jun 2025 16:21:13 -0700	[thread overview]
Message-ID: <aFCm6TuOAr5cokFw@mini-arch> (raw)
In-Reply-To: <1912679.1750099002@famine>

On 06/16, Jay Vosburgh wrote:
> Stanislav Fomichev <stfomichev@gmail.com> wrote:
> 
> >Syzkaller reports the following issue:
> >
> > RTNL: assertion failed at ./include/net/netdev_lock.h (72)
> > WARNING: CPU: 0 PID: 1141 at ./include/net/netdev_lock.h:72 netdev_ops_assert_locked include/net/netdev_lock.h:72 [inline]
> > WARNING: CPU: 0 PID: 1141 at ./include/net/netdev_lock.h:72 __linkwatch_sync_dev+0x1ed/0x230 net/core/link_watch.c:279
> >
> > ethtool_op_get_link+0x1d/0x70 net/ethtool/ioctl.c:63
> > bond_check_dev_link+0x3f9/0x710 drivers/net/bonding/bond_main.c:863
> > bond_miimon_inspect drivers/net/bonding/bond_main.c:2745 [inline]
> > bond_mii_monitor+0x3c0/0x2dc0 drivers/net/bonding/bond_main.c:2967
> > process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238
> > process_scheduled_works kernel/workqueue.c:3321 [inline]
> > worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402
> > kthread+0x3c5/0x780 kernel/kthread.c:464
> > ret_from_fork+0x5d4/0x6f0 arch/x86/kernel/process.c:148
> > ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
> >
> >As discussed in [0], the report is a bit bogus, but it exposes
> >the fact that bond_miimon_inspect might sleep while its being
> >called under RCU read lock. Convert bond_miimon_inspect callers
> >(bond_mii_monitor) to rtnl lock.
> 
> 	Sorry, I missed the discussion on this last week.  This is on
> me, last year this came up and the correct fix is to remove all of the
> obsolete use_carrier logic in bonding.  A round trip on RTNL for every
> miimon pass is not realistic.
> 
> 	I've got the following patch building as we speak, if it doesn't
> blow up I'll post it for real.
> 
> 	Actually, reading the patch now as I write, I need to tweak the
> option setting logic, it should permit setting use_carrier to "on" or 1,
> but nothing else.  I had originally planned to permit setting it to
> anything and ignore the value, but decided later that turning it off
> should fail, as the behavior change implied by "off" won't happen.

That's even better, thanks, will take a look!

  reply	other threads:[~2025-06-16 23:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16 17:22 [PATCH net] bonding: switch bond_miimon_inspect to rtnl lock Stanislav Fomichev
2025-06-16 18:36 ` Jay Vosburgh
2025-06-16 23:21   ` Stanislav Fomichev [this message]
2025-06-16 18:44 ` 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=aFCm6TuOAr5cokFw@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=syzbot+b8c48ea38ca27d150063@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 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.