syzbot


WARNING: refcount bug in put_device

Status: moderation: reported on 2024/11/03 03:15
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+2f9c5069789781b13db9@syzkaller.appspotmail.com
First crash: 7d22h, last: 7d22h

Sample crash report:
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 18520 at lib/refcount.c:28 refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28
Modules linked in:
CPU: 0 UID: 0 PID: 18520 Comm: kworker/0:0 Tainted: G    B              6.12.0-rc5-syzkaller-00005-ge42b1a9a2557 #0
Tainted: [B]=BAD_PAGE
Hardware name: linux,dummy-virt (DT)
Workqueue: usb_hub_wq hub_event
pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
pc : refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28
lr : refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28
sp : ffff80008371b990
x29: ffff80008371b990 x28: 0000000000000000 x27: f6f0000003076400
x26: fbf0000009581800 x25: fbf00000095818a8 x24: ffff80008291d900
x23: 0000000000000000 x22: f6f00000030764d0 x21: fdf000000621cb68
x20: f6f0000003076450 x19: fbf0000003075000 x18: ffffffffffffffff
x17: 312d312f312d312f x16: 316273752f302e64 x15: ffff80008371b3d0
x14: 0000000000000000 x13: ffff80008274e638 x12: 000000000000307e
x11: 000000000000102a x10: ffff800082816a28 x9 : ffff80008274e638
x8 : 00000000fffff02a x7 : ffff8000827fe638 x6 : 000000000000102a
x5 : fff000007f8cb3c8 x4 : c0000000fffff02a x3 : fff07ffffd1d6000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : f6f00000171b8000
Call trace:
 refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28
 __refcount_sub_and_test include/linux/refcount.h:275 [inline]
 __refcount_dec_and_test include/linux/refcount.h:307 [inline]
 refcount_dec_and_test include/linux/refcount.h:325 [inline]
 kref_put include/linux/kref.h:64 [inline]
 kobject_put+0x110/0x114 lib/kobject.c:737
 put_device+0x14/0x24 drivers/base/core.c:3783
 hdm_disconnect+0x84/0xa0 drivers/most/most_usb.c:1129
 usb_unbind_interface+0x78/0x290 drivers/usb/core/driver.c:461
 device_remove drivers/base/dd.c:569 [inline]
 device_remove+0x70/0x80 drivers/base/dd.c:561
 __device_release_driver drivers/base/dd.c:1273 [inline]
 device_release_driver_internal+0x1d4/0x230 drivers/base/dd.c:1296
 device_release_driver+0x18/0x24 drivers/base/dd.c:1319
 bus_remove_device+0xcc/0x10c drivers/base/bus.c:576
 device_del+0x14c/0x380 drivers/base/core.c:3864
 usb_disable_device+0xd8/0x1b0 drivers/usb/core/message.c:1418
 usb_disconnect+0xd8/0x2bc drivers/usb/core/hub.c:2304
 hub_port_connect drivers/usb/core/hub.c:5361 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
 port_event drivers/usb/core/hub.c:5821 [inline]
 hub_event+0x98c/0x1558 drivers/usb/core/hub.c:5903
 process_one_work+0x15c/0x29c kernel/workqueue.c:3229
 process_scheduled_works kernel/workqueue.c:3310 [inline]
 worker_thread+0x24c/0x354 kernel/workqueue.c:3391
 kthread+0x114/0x118 kernel/kthread.c:389
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
kobject: '(null)' (000000001d5fa2db): is not initialized, yet kobject_put() is being called.
WARNING: CPU: 0 PID: 18520 at lib/kobject.c:734 kobject_put+0xe0/0x114 lib/kobject.c:734
Modules linked in:
CPU: 0 UID: 0 PID: 18520 Comm: kworker/0:0 Tainted: G    B   W          6.12.0-rc5-syzkaller-00005-ge42b1a9a2557 #0
Tainted: [B]=BAD_PAGE, [W]=WARN
Hardware name: linux,dummy-virt (DT)
Workqueue: usb_hub_wq hub_event
pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
pc : kobject_put+0xe0/0x114 lib/kobject.c:734
lr : kobject_put+0xe0/0x114 lib/kobject.c:734
sp : ffff80008371b9a0
x29: ffff80008371b9a0 x28: 0000000000000000 x27: f6f0000003076400
x26: fbf0000009581800 x25: fbf00000095818a8 x24: ffff80008291d900
x23: 0000000000000000 x22: f6f00000030764d0 x21: fdf000000621cb68
x20: f6f0000003076450 x19: fdf000000621c000 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffdee50fd8
x14: 0000000000000287 x13: ffff800082720078 x12: 0000000000000001
x11: 00000389d0e927a0 x10: fc1179a767fc758c x9 : b943a04bda46a771
x8 : f6f00000171b91d8 x7 : fff000007f8d5880 x6 : 000000000172832f
x5 : 01ffffffffffffff x4 : 0000000000000001 x3 : 0000000000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : f6f00000171b8000
Call trace:
 kobject_put+0xe0/0x114 lib/kobject.c:734
 put_device+0x14/0x24 drivers/base/core.c:3783
 hdm_disconnect+0x8c/0xa0 drivers/most/most_usb.c:1130
 usb_unbind_interface+0x78/0x290 drivers/usb/core/driver.c:461
 device_remove drivers/base/dd.c:569 [inline]
 device_remove+0x70/0x80 drivers/base/dd.c:561
 __device_release_driver drivers/base/dd.c:1273 [inline]
 device_release_driver_internal+0x1d4/0x230 drivers/base/dd.c:1296
 device_release_driver+0x18/0x24 drivers/base/dd.c:1319
 bus_remove_device+0xcc/0x10c drivers/base/bus.c:576
 device_del+0x14c/0x380 drivers/base/core.c:3864
 usb_disable_device+0xd8/0x1b0 drivers/usb/core/message.c:1418
 usb_disconnect+0xd8/0x2bc drivers/usb/core/hub.c:2304
 hub_port_connect drivers/usb/core/hub.c:5361 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
 port_event drivers/usb/core/hub.c:5821 [inline]
 hub_event+0x98c/0x1558 drivers/usb/core/hub.c:5903
 process_one_work+0x15c/0x29c kernel/workqueue.c:3229
 process_scheduled_works kernel/workqueue.c:3310 [inline]
 worker_thread+0x24c/0x354 kernel/workqueue.c:3391
 kthread+0x114/0x118 kernel/kthread.c:389
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
---[ end trace 0000000000000000 ]---

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/30 03:04 upstream e42b1a9a2557 66aeb999 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte WARNING: refcount bug in put_device
* Struck through repros no longer work on HEAD.