syzbot


WARNING: suspicious RCU usage in bond_ethtool_get_ts_info

Status: fixed on 2023/02/24 13:50
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+92beb3d46aab498710fa@syzkaller.appspotmail.com
Fix commit: 9b80ccda233f bonding: fix missed rcu protection
First crash: 938d, last: 935d
Cause bisection: introduced by (bisect log) :
commit aa6034678e873db8bd5c5a4b73f8b88c469374d6
Author: Hangbin Liu <liuhangbin@gmail.com>
Date: Fri Jan 21 08:25:18 2022 +0000

  bonding: use rcu_dereference_rtnl when get bonding active slave

Crash: WARNING: suspicious RCU usage in bond_ethtool_get_ts_info (log)
Repro: C syz .config
  
Discussions (7)
Title Replies (including bot) Last reply
[PATCH 5.17 000/772] 5.17.14-rc1 review 793 (793) 2022/06/20 15:05
[PATCH 5.18 000/879] 5.18.3-rc1 review 893 (893) 2022/06/09 06:12
[PATCHv3 net] bonding: fix missed rcu protection 3 (3) 2022/05/20 02:00
[PATCHv2 net] bonding: fix missed rcu protection 7 (7) 2022/05/19 14:34
[PATCH RESEND net] bonding: fix missed rcu protection 7 (7) 2022/05/17 08:04
[PATCH] bond: fix missed rcu protection 1 (1) 2022/05/13 10:30
[syzbot] WARNING: suspicious RCU usage in bond_ethtool_get_ts_info 2 (3) 2022/05/13 08:48

Sample crash report:
=============================
WARNING: suspicious RCU usage
5.18.0-rc6-syzkaller-00009-gfeb9c5e19e91 #0 Not tainted
-----------------------------
include/net/bonding.h:353 suspicious rcu_dereference_check() usage!

other info that might help us debug this:


rcu_scheduler_active = 2, debug_locks = 1
1 lock held by syz-executor120/3598:
 #0: ffff888017d721b0 (sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1682 [inline]
 #0: ffff888017d721b0 (sk_lock-AF_INET){+.+.}-{0:0}, at: sock_setsockopt+0x1e3/0x2d60 net/core/sock.c:1043

stack backtrace:
CPU: 1 PID: 3598 Comm: syz-executor120 Not tainted 5.18.0-rc6-syzkaller-00009-gfeb9c5e19e91 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 bond_option_active_slave_get_rcu include/net/bonding.h:353 [inline]
 bond_ethtool_get_ts_info+0x32c/0x3a0 drivers/net/bonding/bond_main.c:5595
 __ethtool_get_ts_info+0x173/0x240 net/ethtool/common.c:551
 ethtool_get_phc_vclocks+0x99/0x110 net/ethtool/common.c:565
 sock_timestamping_bind_phc net/core/sock.c:846 [inline]
 sock_set_timestamping+0x3a3/0x7e0 net/core/sock.c:893
 sock_setsockopt+0x543/0x2d60 net/core/sock.c:1198
 __sys_setsockopt+0x55e/0x6a0 net/socket.c:2176
 __do_sys_setsockopt net/socket.c:2191 [inline]
 __se_sys_setsockopt net/socket.c:2188 [inline]
 __x64_sys_setsockopt+0xba/0x150 net/socket.c:2188
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f60f6db8b39
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/05/11 20:27 upstream feb9c5e19e91 beb0b407 .config strace log report syz C ci-upstream-kasan-gce WARNING: suspicious RCU usage in bond_ethtool_get_ts_info
2022/05/14 18:15 upstream ec7f49619d8e 744a39e2 .config console log report syz C ci-upstream-kasan-gce-386 WARNING: suspicious RCU usage in bond_ethtool_get_ts_info
2022/05/11 20:29 net-old 3cc5c6a7829a beb0b407 .config strace log report syz C ci-upstream-net-this-kasan-gce WARNING: suspicious RCU usage in bond_ethtool_get_ts_info
2022/05/11 20:11 net-next-old 01f4685797a5 beb0b407 .config strace log report syz C ci-upstream-net-kasan-gce WARNING: suspicious RCU usage in bond_ethtool_get_ts_info
2022/05/13 04:31 upstream 0ac824f379fb 9ad6612a .config console log report info ci-upstream-kasan-gce WARNING: suspicious RCU usage in bond_ethtool_get_ts_info
2022/05/11 19:56 net-next-old 01f4685797a5 beb0b407 .config console log report info ci-upstream-net-kasan-gce WARNING: suspicious RCU usage in bond_ethtool_get_ts_info
* Struck through repros no longer work on HEAD.