================================================================== BUG: KASAN: use-after-free in __mutex_lock_common kernel/locking/mutex.c:938 [inline] BUG: KASAN: use-after-free in __mutex_lock+0x105d/0x13e0 kernel/locking/mutex.c:1103 Read of size 8 at addr ffff88809e0cc150 by task kworker/1:0/17 CPU: 1 PID: 17 Comm: kworker/1:0 Not tainted 5.7.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x128/0x182 lib/dump_stack.c:118 print_address_description.constprop.8.cold.10+0x9/0x317 mm/kasan/report.c:382 __kasan_report.cold.11+0x35/0x4d mm/kasan/report.c:511 kasan_report+0x32/0x50 mm/kasan/common.c:625 __mutex_lock_common kernel/locking/mutex.c:938 [inline] __mutex_lock+0x105d/0x13e0 kernel/locking/mutex.c:1103 joydev_mark_dead drivers/input/joydev.c:729 [inline] joydev_cleanup+0x1c/0x170 drivers/input/joydev.c:738 joydev_disconnect+0x40/0xb0 drivers/input/joydev.c:1010 __input_unregister_device+0x199/0x3f0 drivers/input/input.c:2091 input_unregister_device+0x7f/0xb0 drivers/input/input.c:2273 hidinput_disconnect+0x13f/0x3b0 drivers/hid/hid-input.c:1968 hid_disconnect+0xda/0x150 drivers/hid/hid-core.c:2008 hid_hw_stop+0xa/0x70 drivers/hid/hid-core.c:2055 hid_device_remove+0xbe/0x1f0 drivers/hid/hid-core.c:2296 __device_release_driver drivers/base/dd.c:1110 [inline] device_release_driver_internal+0x1d2/0x470 drivers/base/dd.c:1141 bus_remove_device+0x293/0x460 drivers/base/bus.c:533 device_del+0x421/0xc00 drivers/base/core.c:2734 hid_remove_device drivers/hid/hid-core.c:2467 [inline] hid_destroy_device+0xba/0x120 drivers/hid/hid-core.c:2486 usbhid_disconnect+0x8e/0xc0 drivers/hid/usbhid/hid-core.c:1434 usb_unbind_interface+0x15c/0x870 drivers/usb/core/driver.c:436 __device_release_driver drivers/base/dd.c:1110 [inline] device_release_driver_internal+0x1d2/0x470 drivers/base/dd.c:1141 bus_remove_device+0x293/0x460 drivers/base/bus.c:533 device_del+0x421/0xc00 drivers/base/core.c:2734 usb_disable_device+0x1ae/0x580 drivers/usb/core/message.c:1245 usb_disconnect+0x227/0x850 drivers/usb/core/hub.c:2216 hub_port_connect drivers/usb/core/hub.c:5058 [inline] hub_port_connect_change drivers/usb/core/hub.c:5347 [inline] port_event drivers/usb/core/hub.c:5493 [inline] hub_event+0x1048/0x2d60 drivers/usb/core/hub.c:5575 process_one_work+0x908/0x15d0 kernel/workqueue.c:2268 worker_thread+0x82/0xb50 kernel/workqueue.c:2414 kthread+0x340/0x410 kernel/kthread.c:268 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:351 Allocated by task 2689: save_stack+0x19/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc.constprop.17+0xc1/0xd0 mm/kasan/common.c:495 kmem_cache_alloc_trace+0x156/0x780 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] joydev_connect+0x6b/0xc10 drivers/input/joydev.c:913 input_attach_handler+0xfc/0x170 drivers/input/input.c:1031 input_register_device.cold.21+0xb4/0x1ea drivers/input/input.c:2229 hidinput_connect+0x4498/0xd620 drivers/hid/hid-input.c:1935 hid_connect+0x66c/0x950 drivers/hid/hid-core.c:1931 hid_hw_start+0x75/0x100 drivers/hid/hid-core.c:2035 sony_probe+0x1a4/0x250 drivers/hid/hid-sony.c:2868 hid_device_probe+0x260/0x350 drivers/hid/hid-core.c:2263 really_probe+0x1f9/0x5e0 drivers/base/dd.c:520 driver_probe_device+0xc9/0x1b0 drivers/base/dd.c:697 bus_for_each_drv+0x117/0x1a0 drivers/base/bus.c:431 __device_attach+0x1be/0x2c0 drivers/base/dd.c:870 bus_probe_device+0x19e/0x250 drivers/base/bus.c:491 device_add+0x1089/0x1a00 drivers/base/core.c:2557 hid_add_device+0x2da/0x8b0 drivers/hid/hid-core.c:2419 usbhid_probe+0x9da/0xe70 drivers/hid/usbhid/hid-core.c:1407 usb_probe_interface+0x268/0x6c0 drivers/usb/core/driver.c:374 really_probe+0x1f9/0x5e0 drivers/base/dd.c:520 driver_probe_device+0xc9/0x1b0 drivers/base/dd.c:697 bus_for_each_drv+0x117/0x1a0 drivers/base/bus.c:431 __device_attach+0x1be/0x2c0 drivers/base/dd.c:870 bus_probe_device+0x19e/0x250 drivers/base/bus.c:491 device_add+0x1089/0x1a00 drivers/base/core.c:2557 usb_set_configuration+0xcc8/0x1640 drivers/usb/core/message.c:2032 usb_generic_driver_probe+0x61/0x90 drivers/usb/core/generic.c:241 usb_probe_device+0x91/0x160 drivers/usb/core/driver.c:272 really_probe+0x1f9/0x5e0 drivers/base/dd.c:520 driver_probe_device+0xc9/0x1b0 drivers/base/dd.c:697 bus_for_each_drv+0x117/0x1a0 drivers/base/bus.c:431 __device_attach+0x1be/0x2c0 drivers/base/dd.c:870 bus_probe_device+0x19e/0x250 drivers/base/bus.c:491 device_add+0x1089/0x1a00 drivers/base/core.c:2557 usb_new_device.cold.66+0x679/0xe85 drivers/usb/core/hub.c:2553 hub_port_connect drivers/usb/core/hub.c:5207 [inline] hub_port_connect_change drivers/usb/core/hub.c:5347 [inline] port_event drivers/usb/core/hub.c:5493 [inline] hub_event+0x15fe/0x2d60 drivers/usb/core/hub.c:5575 process_one_work+0x908/0x15d0 kernel/workqueue.c:2268 worker_thread+0x82/0xb50 kernel/workqueue.c:2414 kthread+0x340/0x410 kernel/kthread.c:268 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:351 Freed by task 17: save_stack+0x19/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:456 __cache_free mm/slab.c:3426 [inline] kfree+0x107/0x2b0 mm/slab.c:3757 device_release+0x65/0x1c0 drivers/base/core.c:1394 kobject_cleanup lib/kobject.c:701 [inline] kobject_release lib/kobject.c:732 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x12e/0x230 lib/kobject.c:749 joydev_disconnect+0x38/0xb0 drivers/input/joydev.c:1009 __input_unregister_device+0x199/0x3f0 drivers/input/input.c:2091 input_unregister_device+0x7f/0xb0 drivers/input/input.c:2273 hidinput_disconnect+0x13f/0x3b0 drivers/hid/hid-input.c:1968 hid_disconnect+0xda/0x150 drivers/hid/hid-core.c:2008 hid_hw_stop+0xa/0x70 drivers/hid/hid-core.c:2055 hid_device_remove+0xbe/0x1f0 drivers/hid/hid-core.c:2296 __device_release_driver drivers/base/dd.c:1110 [inline] device_release_driver_internal+0x1d2/0x470 drivers/base/dd.c:1141 bus_remove_device+0x293/0x460 drivers/base/bus.c:533 device_del+0x421/0xc00 drivers/base/core.c:2734 hid_remove_device drivers/hid/hid-core.c:2467 [inline] hid_destroy_device+0xba/0x120 drivers/hid/hid-core.c:2486 usbhid_disconnect+0x8e/0xc0 drivers/hid/usbhid/hid-core.c:1434 usb_unbind_interface+0x15c/0x870 drivers/usb/core/driver.c:436 __device_release_driver drivers/base/dd.c:1110 [inline] device_release_driver_internal+0x1d2/0x470 drivers/base/dd.c:1141 bus_remove_device+0x293/0x460 drivers/base/bus.c:533 device_del+0x421/0xc00 drivers/base/core.c:2734 usb_disable_device+0x1ae/0x580 drivers/usb/core/message.c:1245 usb_disconnect+0x227/0x850 drivers/usb/core/hub.c:2216 hub_port_connect drivers/usb/core/hub.c:5058 [inline] hub_port_connect_change drivers/usb/core/hub.c:5347 [inline] port_event drivers/usb/core/hub.c:5493 [inline] hub_event+0x1048/0x2d60 drivers/usb/core/hub.c:5575 process_one_work+0x908/0x15d0 kernel/workqueue.c:2268 worker_thread+0x82/0xb50 kernel/workqueue.c:2414 kthread+0x340/0x410 kernel/kthread.c:268 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:351 The buggy address belongs to the object at ffff88809e0cc000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 336 bytes inside of 8192-byte region [ffff88809e0cc000, ffff88809e0ce000) The buggy address belongs to the page: page:ffffea0002783300 refcount:1 mapcount:0 mapping:000000000e62b8fe index:0x0 head:ffffea0002783300 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00027cfe08 ffffea00027a5408 ffff8880aa4021c0 raw: 0000000000000000 ffff88809e0cc000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809e0cc000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809e0cc080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809e0cc100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809e0cc180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809e0cc200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================