syzbot


WARNING: suspicious RCU usage in phonet_route_del

Status: internal: reported C repro on 2024/11/02 04:11
Subsystems: net
[Documentation on labels]
Fix commit: 38a1f50a5efb phonet: do not call synchronize_rcu() from phonet_route_del()
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu-native-arm64-kvm ci-qemu2-riscv64 ci-upstream-gce-arm64]
First crash: 32d, last: 28d
Cause bisection: introduced by (bisect log) :
commit 17a1ac0018ae1cee0b2c2235ce54e91ecbbed7be
Author: Kuniyuki Iwashima <kuniyu@amazon.com>
Date: Thu Oct 17 18:31:40 2024 +0000

  phonet: Don't hold RTNL for route_doit().

Crash: WARNING: suspicious RCU usage in phonet_route_del (log)
Repro: C syz .config
  
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/11/04 14:37 35m edumazet@google.com patch net-next report log

Sample crash report:
netlink: 'syz-executor427': attribute type 1 has an invalid length.
netlink: 'syz-executor427': attribute type 4 has an invalid length.
netlink: 15334 bytes leftover after parsing attributes in process `syz-executor427'.
netlink: 'syz-executor427': attribute type 1 has an invalid length.
netlink: 'syz-executor427': attribute type 4 has an invalid length.
netlink: 15334 bytes leftover after parsing attributes in process `syz-executor427'.
=============================
WARNING: suspicious RCU usage
6.12.0-rc5-syzkaller-01056-gf07a6e6ceb05 #0 Not tainted
-----------------------------
kernel/rcu/tree.c:4092 Illegal synchronize_rcu() in RCU read-side critical section!

other info that might help us debug this:


rcu_scheduler_active = 2, debug_locks = 1
1 lock held by syz-executor427/5840:
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: route_doit+0x3d6/0x640 net/phonet/pn_netlink.c:264

stack backtrace:
CPU: 1 UID: 0 PID: 5840 Comm: syz-executor427 Not tainted 6.12.0-rc5-syzkaller-01056-gf07a6e6ceb05 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 lockdep_rcu_suspicious+0x226/0x340 kernel/locking/lockdep.c:6821
 synchronize_rcu+0xea/0x360 kernel/rcu/tree.c:4089
 phonet_route_del+0xc6/0x140 net/phonet/pn_dev.c:409
 route_doit+0x514/0x640 net/phonet/pn_netlink.c:275
 rtnetlink_rcv_msg+0x791/0xcf0 net/core/rtnetlink.c:6790
 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2551
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg+0x221/0x270 net/socket.c:744
 sock_write_iter+0x2d7/0x3f0 net/socket.c:1165
 new_sync_write fs/read_write.c:590 [inline]
 vfs_write+0xaeb/0xd30 fs/read_write.c:683
 ksys_write+0x183/0x2b0 fs/read_write.c:736
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5a658865a9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8265cfa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffe8265d178 RCX: 00007f5a658865a9
RDX: 000000000000fe33 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007f5a658f9610 R08: 00007ffe8265d178 R09: 00007ffe8265d178
R10: 00007ffe8265d178 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe8265d168 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
BUG: sleeping function called from invalid context at kernel/rcu/tree.c:4003
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 5840, name: syz-executor427
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
1 lock held by syz-executor427/5840:
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: route_doit+0x3d6/0x640 net/phonet/pn_netlink.c:264
CPU: 1 UID: 0 PID: 5840 Comm: syz-executor427 Not tainted 6.12.0-rc5-syzkaller-01056-gf07a6e6ceb05 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 __might_resched+0x5d4/0x780 kernel/sched/core.c:8653
 rcu_blocking_is_gp kernel/rcu/tree.c:4003 [inline]
 synchronize_rcu+0x104/0x360 kernel/rcu/tree.c:4093
 phonet_route_del+0xc6/0x140 net/phonet/pn_dev.c:409
 route_doit+0x514/0x640 net/phonet/pn_netlink.c:275
 rtnetlink_rcv_msg+0x791/0xcf0 net/core/rtnetlink.c:6790
 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2551
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg+0x221/0x270 net/socket.c:744
 sock_write_iter+0x2d7/0x3f0 net/socket.c:1165
 new_sync_write fs/read_write.c:590 [inline]
 vfs_write+0xaeb/0xd30 fs/read_write.c:683
 ksys_write+0x183/0x2b0 fs/read_write.c:736
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5a658865a9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8265cfa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffe8265d178 RCX: 00007f5a658865a9
RDX: 000000000000fe33 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007f5a658f9610 R08: 00007ffe8265d178 R09: 00007ffe8265d178
R10: 00007ffe8265d178 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe8265d168 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

=============================
WARNING: suspicious RCU usage
6.12.0-rc5-syzkaller-01056-gf07a6e6ceb05 #0 Tainted: G        W         
-----------------------------
kernel/rcu/tree_exp.h:949 Illegal synchronize_rcu_expedited() in RCU read-side critical section!

other info that might help us debug this:


rcu_scheduler_active = 2, debug_locks = 1
1 lock held by syz-executor427/5840:
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #0: ffffffff8e937da0 (rcu_read_lock){....}-{1:2}, at: route_doit+0x3d6/0x640 net/phonet/pn_netlink.c:264

stack backtrace:
CPU: 0 UID: 0 PID: 5840 Comm: syz-executor427 Tainted: G        W          6.12.0-rc5-syzkaller-01056-gf07a6e6ceb05 #0
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 lockdep_rcu_suspicious+0x226/0x340 kernel/locking/lockdep.c:6821
 synchronize_rcu_expedited+0x12e/0x830 kernel/rcu/tree_exp.h:946
 synchronize_rcu+0x11b/0x360 kernel/rcu/tree.c:4095
 phonet_route_del+0xc6/0x140 net/phonet/pn_dev.c:409
 route_doit+0x514/0x640 net/phonet/pn_netlink.c:275
 rtnetlink_rcv_msg+0x791/0xcf0 net/core/rtnetlink.c:6790
 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2551
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg+0x221/0x270 net/socket.c:744
 sock_write_iter+0x2d7/0x3f0 net/socket.c:1165
 new_sync_write fs/read_write.c:590 [inline]
 vfs_write+0xaeb/0xd30 fs/read_write.c:683
 ksys_write+0x183/0x2b0 fs/read_write.c:736
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5a658865a9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8265cfa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffe8265d178 RCX: 00007f5a658865a9
RDX: 000000000000fe33 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007f5a658f9610 R08: 00007ffe8265d178 R09: 00007ffe8265d178
R10: 00007ffe8265d178 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe8265d168 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
------------[ cut here ]------------
Voluntary context switch within RCU read-side critical section!
WARNING: CPU: 0 PID: 5840 at kernel/rcu/tree_plugin.h:331 rcu_note_context_switch+0xcf4/0xff0 kernel/rcu/tree_plugin.h:331
Modules linked in:
CPU: 0 UID: 0 PID: 5840 Comm: syz-executor427 Tainted: G        W          6.12.0-rc5-syzkaller-01056-gf07a6e6ceb05 #0
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:rcu_note_context_switch+0xcf4/0xff0 kernel/rcu/tree_plugin.h:331
Code: 00 ba 02 00 00 00 e8 7b f8 fd ff 4c 8b b4 24 80 00 00 00 eb 91 c6 05 12 45 8b 0e 01 90 48 c7 c7 80 28 0c 8c e8 6d 29 da ff 90 <0f> 0b 90 90 e9 3b f4 ff ff 90 0f 0b 90 45 84 ed 0f 84 00 f4 ff ff
RSP: 0018:ffffc90003c56dc0 EFLAGS: 00010046
RAX: a8f08f9ee459b500 RBX: ffff88806f9d8444 RCX: ffff88806f9d8000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90003c56f10 R08: ffffffff8155d252 R09: fffffbfff1cf9fd0
R10: dffffc0000000000 R11: fffffbfff1cf9fd0 R12: ffff88806f9d8000
R13: 0000000000000000 R14: 1ffff9200078add0 R15: dffffc0000000000
FS:  000055556bc7f380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000002000f000 CR3: 0000000078e7e000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __schedule+0x348/0x4bd0 kernel/sched/core.c:6570
 __schedule_loop kernel/sched/core.c:6767 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6782
 synchronize_rcu_expedited+0x684/0x830 kernel/rcu/tree_exp.h:991
 synchronize_rcu+0x11b/0x360 kernel/rcu/tree.c:4095
 phonet_route_del+0xc6/0x140 net/phonet/pn_dev.c:409
 route_doit+0x514/0x640 net/phonet/pn_netlink.c:275
 rtnetlink_rcv_msg+0x791/0xcf0 net/core/rtnetlink.c:6790
 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2551
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg+0x221/0x270 net/socket.c:744
 sock_write_iter+0x2d7/0x3f0 net/socket.c:1165
 new_sync_write fs/read_write.c:590 [inline]
 vfs_write+0xaeb/0xd30 fs/read_write.c:683
 ksys_write+0x183/0x2b0 fs/read_write.c:736
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5a658865a9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8265cfa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ffe8265d178 RCX: 00007f5a658865a9
RDX: 000000000000fe33 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 00007f5a658f9610 R08: 00007ffe8265d178 R09: 00007ffe8265d178
R10: 00007ffe8265d178 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe8265d168 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/04 04:20 net-next f07a6e6ceb05 f00eed24 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: suspicious RCU usage in phonet_route_del
2024/11/06 10:34 net-next a84e8c05f583 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: suspicious RCU usage in phonet_route_del
2024/11/06 10:34 net-next a84e8c05f583 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: suspicious RCU usage in phonet_route_del
2024/11/06 08:16 net-next ccb35037c48a 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: suspicious RCU usage in phonet_route_del
2024/11/04 02:18 net-next f07a6e6ceb05 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: suspicious RCU usage in phonet_route_del
2024/11/02 04:10 net-next dbb9a7ef3478 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING: suspicious RCU usage in phonet_route_del
2024/11/04 18:24 linux-next 1ffec08567f4 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: suspicious RCU usage in phonet_route_del
* Struck through repros no longer work on HEAD.