syzbot


WARNING: refcount bug in netdev_unregister_kobject

Status: upstream: reported on 2025/02/16 04:11
Reported-by: syzbot+03f85cee12378fe91d62@syzkaller.appspotmail.com
First crash: 64d, last: 64d

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 5361 at lib/refcount.c:28 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 5361 Comm: kbnepd bnep0 Not tainted 6.1.128-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
lr : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
sp : ffff800021457740
x29: ffff800021457740 x28: 1fffe0001d6ef6f5 x27: dfff800000000000
x26: ffff800021457860 x25: 1fffe0001e52e4d9 x24: 0000000000000000
x23: 1fffe000196a640c x22: ffff80000c2e5ab8 x21: 0000000000000003
x20: ffff0000cb532078 x19: ffff8000184d6000 x18: ffff800021456bc0
x17: 0000000000000000 x16: ffff80001231f9fc x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000000001
x11: 0000000000ff0100 x10: 0000000000000000 x9 : a18f981ac6cfbb00
x8 : a18f981ac6cfbb00 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff800021457038 x4 : ffff800015bd5320 x3 : ffff800008587fd0
x2 : 0000000000000001 x1 : 0000000100000001 x0 : 0000000000000000
Call trace:
 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28
 __refcount_sub_and_test include/linux/refcount.h:283 [inline]
 __refcount_dec_and_test include/linux/refcount.h:315 [inline]
 refcount_dec_and_test include/linux/refcount.h:333 [inline]
 kref_put include/linux/kref.h:64 [inline]
 klist_dec_and_del+0x380/0x3ac lib/klist.c:206
 klist_put lib/klist.c:217 [inline]
 klist_del+0xb0/0x110 lib/klist.c:230
 device_del+0x28c/0x9bc drivers/base/core.c:3863
 netdev_unregister_kobject+0x14c/0x204 net/core/net-sysfs.c:1985
 unregister_netdevice_many+0x11d8/0x1790 net/core/dev.c:10974
 unregister_netdevice_queue net/core/dev.c:10878 [inline]
 unregister_netdevice include/linux/netdevice.h:3067 [inline]
 unregister_netdev+0x178/0x1f0 net/core/dev.c:11006
 bnep_session+0x23c4/0x2584 net/bluetooth/bnep/core.c:525
 kthread+0x250/0x2d8 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864
irq event stamp: 4746
hardirqs last  enabled at (4745): [<ffff8000083402dc>] __up_console_sem+0xb4/0x100 kernel/printk/printk.c:261
hardirqs last disabled at (4746): [<ffff80001231b6dc>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last  enabled at (4600): [<ffff8000081c2ff0>] softirq_handle_end kernel/softirq.c:421 [inline]
softirqs last  enabled at (4600): [<ffff8000081c2ff0>] handle_softirqs+0xb84/0xd58 kernel/softirq.c:606
softirqs last disabled at (4587): [<ffff800008020174>] __do_softirq+0x14/0x20 kernel/softirq.c:612
---[ end trace 0000000000000000 ]---

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/02/16 04:11 linux-6.1.y 0cbb5f65e52f 40a34ec9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: refcount bug in netdev_unregister_kobject
* Struck through repros no longer work on HEAD.