[syzbot] [net?] INFO: task hung in del_device_store

10 views
Skip to first unread message

syzbot

unread,
Mar 5, 2023, 12:44:38ā€ÆPM3/5/23
to da...@davemloft.net, edum...@google.com, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: b01fe98d34f3 Merge tag 'i2c-for-6.3-rc1-part2' of git://gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12441638c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=cab35c936731a347
dashboard link: https://syzkaller.appspot.com/bug?extid=6d10ecc8a97cc10639f9
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/918d4a4cfe62/disk-b01fe98d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5341ab364392/vmlinux-b01fe98d.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bb74b14652fd/bzImage-b01fe98d.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+6d10ec...@syzkaller.appspotmail.com

INFO: task syz-executor.0:19488 blocked for more than 143 seconds.
Not tainted 6.2.0-syzkaller-13534-gb01fe98d34f3 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.0 state:D stack:25064 pid:19488 ppid:1 flags:0x00000004
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5304 [inline]
__schedule+0xcce/0x5b20 kernel/sched/core.c:6622
schedule+0xde/0x1a0 kernel/sched/core.c:6698
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6757
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0xa3b/0x1350 kernel/locking/mutex.c:747
del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
bus_attr_store+0x76/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x114/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x3f1/0x600 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:1851 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x9ed/0xe10 fs/read_write.c:584
ksys_write+0x12b/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f40ed83de7f
RSP: 002b:00007f40edacf220 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f40ed83de7f
RDX: 0000000000000001 RSI: 00007f40edacf270 RDI: 0000000000000005
RBP: 0000000000000005 R08: 0000000000000000 R09: 00007f40edacf1c0
R10: 0000000000000000 R11: 0000000000000293 R12: 00007f40ed8e76fe
R13: 00007f40edacf270 R14: 0000000000000000 R15: 00007f40edacf940
</TASK>
INFO: task syz-executor.4:19495 blocked for more than 143 seconds.
Not tainted 6.2.0-syzkaller-13534-gb01fe98d34f3 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4 state:D stack:25024 pid:19495 ppid:1 flags:0x00000004
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5304 [inline]
__schedule+0xcce/0x5b20 kernel/sched/core.c:6622
schedule+0xde/0x1a0 kernel/sched/core.c:6698
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6757
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0xa3b/0x1350 kernel/locking/mutex.c:747
del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
bus_attr_store+0x76/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x114/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x3f1/0x600 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:1851 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x9ed/0xe10 fs/read_write.c:584
ksys_write+0x12b/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7faad3e3de7f
RSP: 002b:00007faad40cf220 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007faad3e3de7f
RDX: 0000000000000001 RSI: 00007faad40cf270 RDI: 0000000000000005
RBP: 0000000000000005 R08: 0000000000000000 R09: 00007faad40cf1c0
R10: 0000000000000000 R11: 0000000000000293 R12: 00007faad3ee76fe
R13: 00007faad40cf270 R14: 0000000000000000 R15: 00007faad40cf940
</TASK>
INFO: task syz-executor.2:19500 blocked for more than 144 seconds.
Not tainted 6.2.0-syzkaller-13534-gb01fe98d34f3 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.2 state:D stack:24352 pid:19500 ppid:1 flags:0x00000004
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5304 [inline]
__schedule+0xcce/0x5b20 kernel/sched/core.c:6622
schedule+0xde/0x1a0 kernel/sched/core.c:6698
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6757
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0xa3b/0x1350 kernel/locking/mutex.c:747
del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
bus_attr_store+0x76/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x114/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x3f1/0x600 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:1851 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x9ed/0xe10 fs/read_write.c:584
ksys_write+0x12b/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f929f83de7f
RSP: 002b:00007f929facf220 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f929f83de7f
RDX: 0000000000000001 RSI: 00007f929facf270 RDI: 0000000000000005
RBP: 0000000000000005 R08: 0000000000000000 R09: 00007f929facf1c0
R10: 0000000000000000 R11: 0000000000000293 R12: 00007f929f8e76fe
R13: 00007f929facf270 R14: 0000000000000000 R15: 00007f929facf940
</TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
#0: ffffffff8c794eb0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x31/0xd80 kernel/rcu/tasks.h:510
1 lock held by rcu_tasks_trace/13:
#0: ffffffff8c794bb0 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x31/0xd80 kernel/rcu/tasks.h:510
1 lock held by ksoftirqd/1/21:
1 lock held by khungtaskd/28:
#0: ffffffff8c795a00 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x340 kernel/locking/lockdep.c:6495
4 locks held by kworker/u4:2/41:
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:639 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:666 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x86d/0x1820 kernel/workqueue.c:2361
#1: ffffc90000b27da8 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x8a1/0x1820 kernel/workqueue.c:2365
#2: ffffffff8e0ef5d0 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0x9f/0xb10 net/core/net_namespace.c:575
#3: ffffffff8c7a0bc0 (rcu_state.barrier_mutex){+.+.}-{3:3}, at: rcu_barrier+0x48/0x6d0 kernel/rcu/tree.c:3945
3 locks held by kworker/u4:3/47:
2 locks held by getty/4761:
#0: ffff8880284b5098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x26/0x80 drivers/tty/tty_ldisc.c:244
#1: ffffc900015a02f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xef4/0x13e0 drivers/tty/n_tty.c:2177
3 locks held by kworker/u4:7/15346:
6 locks held by syz-executor.2/19438:
#0: ffff88802b7b8460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff88801d849c88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff88802103dae8 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6a28 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
#4: ffff8880421d80e8 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:832 [inline]
#4: ffff8880421d80e8 (&dev->mutex){....}-{3:3}, at: __device_driver_lock drivers/base/dd.c:1063 [inline]
#4: ffff8880421d80e8 (&dev->mutex){....}-{3:3}, at: device_release_driver_internal+0xa4/0x610 drivers/base/dd.c:1260
#5: ffffffff8e0ef5d0 (pernet_ops_rwsem){++++}-{3:3}, at: unregister_netdevice_notifier+0x22/0x180 net/core/dev.c:1759
4 locks held by syz-executor.0/19488:
#0: ffff88802b7b8460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff88804a7c4088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff88802103dae8 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6a28 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
4 locks held by syz-executor.4/19495:
#0: ffff88802b7b8460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff88804103ec88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff88802103dae8 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6a28 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
4 locks held by syz-executor.2/19500:
#0: ffff88802b7b8460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff888049360c88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff88802103dae8 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6a28 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
1 lock held by syz-executor.4/19931:
#0: ffffffff8e0ef5d0 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4cb/0x8e0 net/core/net_namespace.c:486
1 lock held by syz-executor.2/19936:
#0: ffffffff8e0ef5d0 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4cb/0x8e0 net/core/net_namespace.c:486
1 lock held by syz-executor.0/19948:
#0: ffffffff8e0ef5d0 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4cb/0x8e0 net/core/net_namespace.c:486

=============================================

NMI backtrace for cpu 0
CPU: 0 PID: 28 Comm: khungtaskd Not tainted 6.2.0-syzkaller-13534-gb01fe98d34f3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
nmi_cpu_backtrace+0x316/0x3e0 lib/nmi_backtrace.c:113
nmi_trigger_cpumask_backtrace+0x33f/0x460 lib/nmi_backtrace.c:62
trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:222 [inline]
watchdog+0xe94/0x11e0 kernel/hung_task.c:379
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 15346 Comm: kworker/u4:7 Not tainted 6.2.0-syzkaller-13534-gb01fe98d34f3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: bat_events batadv_nc_worker
RIP: 0010:kasan_check_range+0x12/0x190 mm/kasan/generic.c:186
Code: 24 df ff ff 89 43 08 5b 5d 41 5c c3 66 66 2e 0f 1f 84 00 00 00 00 00 90 66 0f 1f 00 48 85 f6 0f 84 3c 01 00 00 49 89 f9 41 54 <44> 0f b6 c2 49 01 f1 55 53 0f 82 18 01 00 00 48 b8 ff ff ff ff ff
RSP: 0018:ffffc9000511f9a8 EFLAGS: 00000002
RAX: 000000000000001b RBX: 00000000000006c4 RCX: ffffffff8165ea80
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff914dec58
RBP: 0000000000000004 R08: 0000000000000000 R09: ffffffff914dec58
R10: fffffbfff229bd8b R11: 0000000000000000 R12: 0000000000000001
R13: ffff888050163a80 R14: ffff8880501644b8 R15: dffffc0000000000
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c000d31000 CR3: 000000000c571000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
instrument_atomic_read include/linux/instrumented.h:72 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
hlock_class kernel/locking/lockdep.c:228 [inline]
check_wait_context kernel/locking/lockdep.c:4755 [inline]
__lock_acquire+0x6f0/0x5d40 kernel/locking/lockdep.c:5006
lock_acquire kernel/locking/lockdep.c:5669 [inline]
lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634
rcu_lock_acquire include/linux/rcupdate.h:327 [inline]
rcu_read_lock include/linux/rcupdate.h:773 [inline]
batadv_nc_process_nc_paths.part.0+0xec/0x3f0 net/batman-adv/network-coding.c:687
batadv_nc_process_nc_paths net/batman-adv/network-coding.c:679 [inline]
batadv_nc_worker+0xd20/0xfe0 net/batman-adv/network-coding.c:735
process_one_work+0x9bf/0x1820 kernel/workqueue.c:2390
worker_thread+0x669/0x1090 kernel/workqueue.c:2537
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Mar 12, 2023, 8:08:53ā€ÆPM3/12/23
to da...@davemloft.net, edum...@google.com, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 134231664868 Merge tag 'staging-6.3-rc2' of git://git.kern..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12c8f12ac80000
kernel config: https://syzkaller.appspot.com/x/.config?x=8aef547e348b1ab8
dashboard link: https://syzkaller.appspot.com/bug?extid=6d10ecc8a97cc10639f9
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1064db24c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/810b18cfd92d/disk-13423166.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/49409dbd680c/vmlinux-13423166.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c4a589bbe527/bzImage-13423166.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+6d10ec...@syzkaller.appspotmail.com

INFO: task syz-executor.2:5255 blocked for more than 143 seconds.
Not tainted 6.3.0-rc1-syzkaller-00274-g134231664868 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.2 state:D stack:25064 pid:5255 ppid:1 flags:0x00000004
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5304 [inline]
__schedule+0xc91/0x57d0 kernel/sched/core.c:6622
schedule+0xde/0x1a0 kernel/sched/core.c:6698
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6757
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0xa3b/0x1350 kernel/locking/mutex.c:747
del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
bus_attr_store+0x76/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x114/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x3f1/0x600 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:1851 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x9ed/0xe10 fs/read_write.c:584
ksys_write+0x12b/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fe9c963de7f
RSP: 002b:00007fe9c98cf220 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fe9c963de7f
RDX: 0000000000000001 RSI: 00007fe9c98cf270 RDI: 0000000000000005
RBP: 0000000000000005 R08: 0000000000000000 R09: 00007fe9c98cf1c0
R10: 0000000000000000 R11: 0000000000000293 R12: 00007fe9c96e76fe
R13: 00007fe9c98cf270 R14: 0000000000000000 R15: 00007fe9c98cf940
</TASK>
INFO: task syz-executor.3:5267 blocked for more than 143 seconds.
Not tainted 6.3.0-rc1-syzkaller-00274-g134231664868 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.3 state:D stack:24864 pid:5267 ppid:1 flags:0x00004004
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5304 [inline]
__schedule+0xc91/0x57d0 kernel/sched/core.c:6622
schedule+0xde/0x1a0 kernel/sched/core.c:6698
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6757
__mutex_lock_common kernel/locking/mutex.c:679 [inline]
__mutex_lock+0xa3b/0x1350 kernel/locking/mutex.c:747
del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
bus_attr_store+0x76/0xa0 drivers/base/bus.c:170
sysfs_kf_write+0x114/0x170 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x3f1/0x600 fs/kernfs/file.c:334
call_write_iter include/linux/fs.h:1851 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x9ed/0xe10 fs/read_write.c:584
ksys_write+0x12b/0x250 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f1677c3de7f
RSP: 002b:00007f1677ecf220 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f1677c3de7f
RDX: 0000000000000001 RSI: 00007f1677ecf270 RDI: 0000000000000005
RBP: 0000000000000005 R08: 0000000000000000 R09: 00007f1677ecf1c0
R10: 0000000000000000 R11: 0000000000000293 R12: 00007f1677ce76fe
R13: 00007f1677ecf270 R14: 0000000000000000 R15: 00007f1677ecf940
</TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
#0: ffffffff8c7954b0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x31/0xd80 kernel/rcu/tasks.h:510
1 lock held by rcu_tasks_trace/13:
#0: ffffffff8c7951b0 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x31/0xd80 kernel/rcu/tasks.h:510
3 locks held by kworker/1:0/22:
#0: ffff888012470d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888012470d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
#0: ffff888012470d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
#0: ffff888012470d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:639 [inline]
#0: ffff888012470d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:666 [inline]
#0: ffff888012470d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x87a/0x1710 kernel/workqueue.c:2361
#1: ffffc900001c7da8 ((linkwatch_work).work){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1710 kernel/workqueue.c:2365
#2: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: linkwatch_event+0xf/0x70 net/core/link_watch.c:277
1 lock held by khungtaskd/28:
#0: ffffffff8c796000 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x340 kernel/locking/lockdep.c:6495
1 lock held by dhcpcd/4657:
#0: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: __netlink_dump_start+0x16e/0x910 net/netlink/af_netlink.c:2365
2 locks held by getty/4759:
#0: ffff88802bf24098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x26/0x80 drivers/tty/tty_ldisc.c:244
#1: ffffc900015b02f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xef4/0x13e0 drivers/tty/n_tty.c:2177
4 locks held by kworker/u4:1/5194:
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:639 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:666 [inline]
#0: ffff888016617138 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x87a/0x1710 kernel/workqueue.c:2361
#1: ffffc9000432fda8 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1710 kernel/workqueue.c:2365
#2: ffffffff8e0ef810 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0x9f/0xb10 net/core/net_namespace.c:575
#3: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: ppp_exit_net+0xa6/0x360 drivers/net/ppp/ppp_generic.c:1129
3 locks held by kworker/u4:2/5198:
2 locks held by kworker/0:6/5224:
#0: ffff888012472538 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888012472538 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
#0: ffff888012472538 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
#0: ffff888012472538 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:639 [inline]
#0: ffff888012472538 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:666 [inline]
#0: ffff888012472538 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x87a/0x1710 kernel/workqueue.c:2361
#1: ffffc900044bfda8 ((work_completion)(&rew->rew_work)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1710 kernel/workqueue.c:2365
4 locks held by syz-executor.2/5255:
#0: ffff888018b7c460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff88806cd89488 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff8880214e4490 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6ca8 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
4 locks held by syz-executor.3/5267:
#0: ffff888018b7c460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff88806e3d0c88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff8880214e4490 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6ca8 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
6 locks held by syz-executor.0/5270:
#0: ffff888018b7c460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff88806e0c3c88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff8880214e4490 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6ca8 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
#4: ffff88807eb6e0e8 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:832 [inline]
#4: ffff88807eb6e0e8 (&dev->mutex){....}-{3:3}, at: __device_driver_lock drivers/base/dd.c:1063 [inline]
#4: ffff88807eb6e0e8 (&dev->mutex){....}-{3:3}, at: device_release_driver_internal+0xa4/0x610 drivers/base/dd.c:1260
#5: ffffffff8e0ef810 (pernet_ops_rwsem){++++}-{3:3}, at: unregister_netdevice_notifier+0x22/0x180 net/core/dev.c:1759
4 locks held by syz-executor.3/5503:
#0: ffff888018b7c460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff888070bef488 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff8880214e4490 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6ca8 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
4 locks held by syz-executor.0/5506:
#0: ffff888018b7c460 (sb_writers#8){.+.+}-{0:0}, at: ksys_write+0x12b/0x250 fs/read_write.c:637
#1: ffff88806d8dbc88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x285/0x600 fs/kernfs/file.c:325
#2: ffff8880214e4490 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2a9/0x600 fs/kernfs/file.c:326
#3: ffffffff8d7e6ca8 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xc9/0x4a0 drivers/net/netdevsim/bus.c:209
1 lock held by syz-executor.5/5671:
#0: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:75 [inline]
#0: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x3e8/0xd50 net/core/rtnetlink.c:6171
1 lock held by syz-executor.2/5675:
#0: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:75 [inline]
#0: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x3e8/0xd50 net/core/rtnetlink.c:6171
2 locks held by syz-executor.4/5682:
#0: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:75 [inline]
#0: ffffffff8e103348 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x3e8/0xd50 net/core/rtnetlink.c:6171
#1: ffffffff8c7a12f8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:293 [inline]
#1: ffffffff8c7a12f8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x64a/0x770 kernel/rcu/tree_exp.h:989

=============================================

NMI backtrace for cpu 1
CPU: 1 PID: 28 Comm: khungtaskd Not tainted 6.3.0-rc1-syzkaller-00274-g134231664868 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
nmi_cpu_backtrace+0x29c/0x350 lib/nmi_backtrace.c:113
nmi_trigger_cpumask_backtrace+0x2a4/0x300 lib/nmi_backtrace.c:62
trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:222 [inline]
watchdog+0xe16/0x1150 kernel/hung_task.c:379
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 5198 Comm: kworker/u4:2 Not tainted 6.3.0-rc1-syzkaller-00274-g134231664868 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: bat_events batadv_nc_worker
RIP: 0010:mark_lock.part.0+0x0/0x1970 kernel/locking/lockdep.c:4594
Code: 78 8e e8 53 34 70 00 e9 27 fe ff ff 48 c7 c7 ec 79 78 8e e8 42 34 70 00 e9 b3 fe ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 <41> 57 41 56 41 55 41 89 d5 48 ba 00 00 00 00 00 fc ff df 41 54 49
RSP: 0018:ffffc9000436fa28 EFLAGS: 00000046
RAX: 0000000000000000 RBX: 00000000000006cb RCX: ffffffff81650cf0
RDX: 0000000000000008 RSI: ffff888071ab0a88 RDI: ffff888071ab0000
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff914d6c5f
R10: fffffbfff229ad8b R11: 0000000000000000 R12: ffff888071ab0a88
R13: ffff888071ab0000 R14: ffff888071ab0a38 R15: dffffc0000000000
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ed5ee93600 CR3: 000000000c571000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
mark_lock kernel/locking/lockdep.c:4599 [inline]
mark_usage kernel/locking/lockdep.c:4556 [inline]
__lock_acquire+0x8a8/0x5d40 kernel/locking/lockdep.c:5010
lock_acquire kernel/locking/lockdep.c:5669 [inline]
lock_acquire+0x1af/0x5b0 kernel/locking/lockdep.c:5634
rcu_lock_acquire include/linux/rcupdate.h:327 [inline]
rcu_read_lock include/linux/rcupdate.h:773 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline]
batadv_nc_worker+0x131/0xfe0 net/batman-adv/network-coding.c:719
process_one_work+0x991/0x1710 kernel/workqueue.c:2390

Hillf Danton

unread,
Mar 12, 2023, 10:33:02ā€ÆPM3/12/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 12 Mar 2023 17:08:51 -0700
> HEAD commit: 134231664868 Merge tag 'staging-6.3-rc2' of git://git.kern..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1064db24c80000

See if batadv_nc_worker() is a rcu hog.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 134231664868

--- x/net/batman-adv/network-coding.c
+++ y/net/batman-adv/network-coding.c
@@ -715,6 +715,7 @@ static void batadv_nc_worker(struct work
delayed_work = to_delayed_work(work);
priv_nc = container_of(delayed_work, struct batadv_priv_nc, work);
bat_priv = container_of(priv_nc, struct batadv_priv, nc);
+ goto out;

batadv_nc_purge_orig_hash(bat_priv);
batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash,
@@ -737,6 +738,7 @@ static void batadv_nc_worker(struct work
bat_priv->nc.timestamp_sniffed_purge = jiffies;
}

+out:
/* Schedule a new check */
batadv_nc_start_timer(bat_priv);
}
--

syzbot

unread,
Mar 12, 2023, 10:53:29ā€ÆPM3/12/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+6d10ec...@syzkaller.appspotmail.com

Tested on:

commit: 13423166 Merge tag 'staging-6.3-rc2' of git://git.kern..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1038328ac80000
kernel config: https://syzkaller.appspot.com/x/.config?x=8aef547e348b1ab8
dashboard link: https://syzkaller.appspot.com/bug?extid=6d10ecc8a97cc10639f9
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=16700724c80000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages