From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+9b277e2c2076e2661f61@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] BUG: sleeping function called from invalid context in synchronize_net
Date: Sat, 13 Jul 2024 09:13:17 +0800 [thread overview]
Message-ID: <20240713011317.1220-1-hdanton@sina.com> (raw)
In-Reply-To: <000000000000e1d1a2061cff308e@google.com>
On Thu, 11 Jul 2024 14:10:22 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 523b23f0bee3 Add linux-next specific files for 20240710
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10ec9585980000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 523b23f0bee3
--- x/net/ethtool/ioctl.c
+++ y/net/ethtool/ioctl.c
@@ -58,10 +58,11 @@ static struct devlink *netdev_to_devlink
u32 ethtool_op_get_link(struct net_device *dev)
{
- /* Synchronize carrier state with link watch, see also rtnl_getlink() */
- linkwatch_sync_dev(dev);
+ u32 rc = netif_carrier_ok(dev) ? 1 : 0;
- return netif_carrier_ok(dev) ? 1 : 0;
+ linkwatch_fire_event(NULL);
+
+ return rc;
}
EXPORT_SYMBOL(ethtool_op_get_link);
--- x/net/core/link_watch.c
+++ y/net/core/link_watch.c
@@ -286,13 +286,17 @@ static void linkwatch_event(struct work_
void linkwatch_fire_event(struct net_device *dev)
{
- bool urgent = linkwatch_urgent_event(dev);
+ bool urgent = true;
+ if (!dev)
+ goto sched;
+ urgent = linkwatch_urgent_event(dev);
if (!test_and_set_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state)) {
linkwatch_add_event(dev);
} else if (!urgent)
return;
+sched:
linkwatch_schedule_work(urgent);
}
EXPORT_SYMBOL(linkwatch_fire_event);
--
next prev parent reply other threads:[~2024-07-13 1:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 19:02 syzbot
2024-07-11 21:10 ` syzbot
2024-07-13 1:13 ` Hillf Danton [this message]
2024-07-13 2:01 ` syzbot
2024-07-11 21:25 ` Jay Vosburgh
2024-07-20 21:26 ` 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=20240713011317.1220-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+9b277e2c2076e2661f61@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®