syzbot


BUG: spinlock bad magic in netdev_unregister_kobject

Status: moderation: reported on 2024/04/25 06:53
Subsystems: pm
[Documentation on labels]
Reported-by: syzbot+15a93273d26af18ac819@syzkaller.appspotmail.com
First crash: 32d, last: 21d

Sample crash report:
BUG: spinlock bad magic on CPU#0, kbnepd bnep0/13924
 lock: 0xffff88806854d708, .magic: ffffffff, .owner: t_bit, nbits)/1651864367, .owner_cpu: 0
CPU: 0 PID: 13924 Comm: kbnepd bnep0 Not tainted 6.9.0-rc4-next-20240418-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x209/0x370 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:120 [inline]
 _raw_spin_lock_irq+0xdf/0x120 kernel/locking/spinlock.c:170
 spin_lock_irq include/linux/spinlock.h:376 [inline]
 pm_runtime_set_memalloc_noio+0x13d/0x260 drivers/base/power/runtime.c:228
 netdev_unregister_kobject+0x178/0x250 net/core/net-sysfs.c:2106
 unregister_netdevice_many_notify+0x11dd/0x16e0 net/core/dev.c:11208
 unregister_netdevice_many net/core/dev.c:11236 [inline]
 unregister_netdevice_queue+0x303/0x370 net/core/dev.c:11115
 unregister_netdevice include/linux/netdevice.h:3118 [inline]
 unregister_netdev+0x1c/0x30 net/core/dev.c:11254
 bnep_session+0x2e09/0x3000 net/bluetooth/bnep/core.c:525
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in kernel/locking/qspinlock.c:131:9
index 9394 is out of range for type 'unsigned long[8]'
CPU: 0 PID: 13924 Comm: kbnepd bnep0 Not tainted 6.9.0-rc4-next-20240418-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 ubsan_epilogue lib/ubsan.c:231 [inline]
 __ubsan_handle_out_of_bounds+0x121/0x150 lib/ubsan.c:429
 decode_tail kernel/locking/qspinlock.c:131 [inline]
 __pv_queued_spin_lock_slowpath+0xd5a/0xdc0 kernel/locking/qspinlock.c:468
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
 queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x272/0x370 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:120 [inline]
 _raw_spin_lock_irq+0xdf/0x120 kernel/locking/spinlock.c:170
 spin_lock_irq include/linux/spinlock.h:376 [inline]
 pm_runtime_set_memalloc_noio+0x13d/0x260 drivers/base/power/runtime.c:228
 netdev_unregister_kobject+0x178/0x250 net/core/net-sysfs.c:2106
 unregister_netdevice_many_notify+0x11dd/0x16e0 net/core/dev.c:11208
 unregister_netdevice_many net/core/dev.c:11236 [inline]
 unregister_netdevice_queue+0x303/0x370 net/core/dev.c:11115
 unregister_netdevice include/linux/netdevice.h:3118 [inline]
 unregister_netdev+0x1c/0x30 net/core/dev.c:11254
 bnep_session+0x2e09/0x3000 net/bluetooth/bnep/core.c:525
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
---[ end trace ]---

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/21 06:48 linux-next 7b4f2bc91c15 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: spinlock bad magic in netdev_unregister_kobject
2024/05/02 09:16 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6a71d2909427 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: spinlock bad magic in netdev_unregister_kobject
* Struck through repros no longer work on HEAD.