Skip to content

Commit 3e7917c

Browse files
Eric Dumazetkuba-moo
Eric Dumazet
authored andcommitted
net: linkwatch: use system_unbound_wq
linkwatch_event() grabs possibly very contended RTNL mutex. system_wq is not suitable for such work. Inspired by many noisy syzbot reports. 3 locks held by kworker/0:7/5266: #0: ffff888015480948 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3206 [inline] #0: ffff888015480948 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312 #1: ffffc90003f6fd00 ((linkwatch_work).work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3207 [inline] , at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312 #2: ffffffff8fa6f208 (rtnl_mutex){+.+.}-{3:3}, at: linkwatch_event+0xe/0x60 net/core/link_watch.c:276 Reported-by: syzbot <[email protected]> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 92c4ee2 commit 3e7917c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/core/link_watch.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ static void linkwatch_schedule_work(int urgent)
148148
* override the existing timer.
149149
*/
150150
if (test_bit(LW_URGENT, &linkwatch_flags))
151-
mod_delayed_work(system_wq, &linkwatch_work, 0);
151+
mod_delayed_work(system_unbound_wq, &linkwatch_work, 0);
152152
else
153-
schedule_delayed_work(&linkwatch_work, delay);
153+
queue_delayed_work(system_unbound_wq, &linkwatch_work, delay);
154154
}
155155

156156

0 commit comments

Comments
 (0)