xpad 2-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 2-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19 ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x26f/0x2b0 kernel/locking/spinlock_debug.c:114 Read of size 4 at addr ffff888112ae085c by task kworker/1:1/9120 CPU: 1 PID: 9120 Comm: kworker/1:1 Not tainted 6.7.0-rc3-syzkaller-00059-g5e4c8814a431 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x26f/0x2b0 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x50 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:105 [inline] __wake_up+0x1c/0x50 kernel/sched/wait.c:127 __usb_unanchor_urb drivers/usb/core/urb.c:156 [inline] usb_anchor_resume_wakeups+0xc2/0xe0 drivers/usb/core/urb.c:150 __usb_hcd_giveback_urb+0x384/0x5c0 drivers/usb/core/hcd.c:1653 usb_hcd_giveback_urb+0x389/0x430 drivers/usb/core/hcd.c:1733 dummy_timer+0x1415/0x35f0 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x193/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x764/0xb10 kernel/time/timer.c:2022 run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035 __do_softirq+0x20a/0x94b kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xa7/0x110 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x8e/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:console_flush_all+0xa0c/0xd50 kernel/printk/printk.c:2973 Code: e8 a9 59 23 00 9c 5b 81 e3 00 02 00 00 31 ff 48 89 de e8 07 9f 1c 00 48 85 db 0f 85 74 01 00 00 e8 69 a3 1c 00 fb 48 8b 04 24 <4c> 89 fa 83 e2 07 0f b6 00 38 d0 7f 08 84 c0 0f 85 4b 02 00 00 41 RSP: 0018:ffffc9000e54e608 EFLAGS: 00000246 RAX: fffff52001ca9ce8 RBX: 0000000000000000 RCX: ffffc9000c8fe000 RDX: 0000000000040000 RSI: ffffffff81314f37 RDI: 0000000000000007 RBP: dffffc0000000000 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 205d303231395420 R12: 0000000000000001 R13: ffffffff88358098 R14: ffffffff88358040 R15: ffffc9000e54e740 console_unlock+0x10c/0x260 kernel/printk/printk.c:3036 vprintk_emit+0x17f/0x5f0 kernel/printk/printk.c:2303 dev_vprintk_emit drivers/base/core.c:4850 [inline] dev_printk_emit+0xfb/0x140 drivers/base/core.c:4861 __dev_printk+0xf5/0x270 drivers/base/core.c:4873 _dev_info+0xe5/0x120 drivers/base/core.c:4919 hid_connect+0x1312/0x18a0 drivers/hid/hid-core.c:2268 hid_hw_start drivers/hid/hid-core.c:2309 [inline] hid_hw_start+0xa0/0x130 drivers/hid/hid-core.c:2300 kone_probe drivers/hid/hid-roccat-kone.c:764 [inline] kone_probe+0xb7/0x730 drivers/hid/hid-roccat-kone.c:751 __hid_device_probe drivers/hid/hid-core.c:2633 [inline] hid_device_probe+0x2e4/0x480 drivers/hid/hid-core.c:2670 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x117e/0x1aa0 drivers/base/core.c:3625 hid_add_device+0x37a/0xa60 drivers/hid/hid-core.c:2816 usbhid_probe+0xd0a/0x1360 drivers/hid/usbhid/hid-core.c:1429 usb_probe_interface+0x307/0x930 drivers/usb/core/driver.c:399 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x117e/0x1aa0 drivers/base/core.c:3625 usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2207 usb_generic_driver_probe+0xad/0x110 drivers/usb/core/generic.c:245 usb_probe_device+0xec/0x350 drivers/usb/core/driver.c:294 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x117e/0x1aa0 drivers/base/core.c:3625 usb_new_device+0xd80/0x19f0 drivers/usb/core/hub.c:2582 hub_port_connect drivers/usb/core/hub.c:5451 [inline] hub_port_connect_change drivers/usb/core/hub.c:5591 [inline] port_event drivers/usb/core/hub.c:5751 [inline] hub_event+0x2e62/0x4f40 drivers/usb/core/hub.c:5833 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Allocated by task 22: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x87/0x90 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] xpad_probe+0x27e/0x1f40 drivers/input/joystick/xpad.c:2004 usb_probe_interface+0x307/0x930 drivers/usb/core/driver.c:399 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x117e/0x1aa0 drivers/base/core.c:3625 usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2207 usb_generic_driver_probe+0xad/0x110 drivers/usb/core/generic.c:245 usb_probe_device+0xec/0x350 drivers/usb/core/driver.c:294 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x234/0xc90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830 __device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958 bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x117e/0x1aa0 drivers/base/core.c:3625 usb_new_device+0xd80/0x19f0 drivers/usb/core/hub.c:2582 hub_port_connect drivers/usb/core/hub.c:5451 [inline] hub_port_connect_change drivers/usb/core/hub.c:5591 [inline] port_event drivers/usb/core/hub.c:5751 [inline] hub_event+0x2e62/0x4f40 drivers/usb/core/hub.c:5833 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Freed by task 689: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x13c/0x190 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xf8/0x1f0 mm/slub.c:3822 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2185 usb_unbind_interface+0x1dd/0x8d0 drivers/usb/core/driver.c:461 device_remove drivers/base/dd.c:569 [inline] device_remove+0x11f/0x170 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1272 [inline] device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295 bus_remove_device+0x22c/0x420 drivers/base/bus.c:574 device_del+0x39a/0xa50 drivers/base/core.c:3814 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1416 usb_disconnect+0x2e1/0x910 drivers/usb/core/hub.c:2243 hub_port_connect drivers/usb/core/hub.c:5291 [inline] hub_port_connect_change drivers/usb/core/hub.c:5591 [inline] port_event drivers/usb/core/hub.c:5751 [inline] hub_event+0x1be0/0x4f40 drivers/usb/core/hub.c:5833 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 The buggy address belongs to the object at ffff888112ae0800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of freed 1024-byte region [ffff888112ae0800, ffff888112ae0c00) The buggy address belongs to the physical page: page:ffffea00044ab800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x112ae0 head:ffffea00044ab800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x200000000000840(slab|head|node=0|zone=2) page_type: 0xffffffff() raw: 0200000000000840 ffff888100041dc0 ffffea0004705a00 dead000000000003 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 8542074355, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x1383/0x33d0 mm/page_alloc.c:3312 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4568 alloc_pages_mpol+0xeb/0x3f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x12c/0x2e0 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x4f/0x100 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] mpi_alloc_limb_space+0x31/0x50 lib/crypto/mpi/mpiutil.c:121 mpi_powm+0xfe2/0x1be0 lib/crypto/mpi/mpi-pow.c:196 _rsa_enc crypto/rsa.c:38 [inline] rsa_enc+0x222/0x3d0 crypto/rsa.c:114 crypto_akcipher_encrypt include/crypto/akcipher.h:348 [inline] pkcs1pad_verify+0x54c/0x6d0 crypto/rsa-pkcs1pad.c:579 crypto_akcipher_verify include/crypto/akcipher.h:455 [inline] crypto_sig_verify+0x180/0x200 crypto/sig.c:128 public_key_verify_signature+0x50c/0x810 crypto/asymmetric_keys/public_key.c:441 x509_check_for_self_signed+0x31a/0x500 crypto/asymmetric_keys/x509_public_key.c:138 page_owner free stack trace missing Memory state around the buggy address: ffff888112ae0700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888112ae0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888112ae0800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888112ae0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888112ae0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: e8 a9 59 23 00 call 0x2359ae 5: 9c pushf 6: 5b pop %rbx 7: 81 e3 00 02 00 00 and $0x200,%ebx d: 31 ff xor %edi,%edi f: 48 89 de mov %rbx,%rsi 12: e8 07 9f 1c 00 call 0x1c9f1e 17: 48 85 db test %rbx,%rbx 1a: 0f 85 74 01 00 00 jne 0x194 20: e8 69 a3 1c 00 call 0x1ca38e 25: fb sti 26: 48 8b 04 24 mov (%rsp),%rax * 2a: 4c 89 fa mov %r15,%rdx <-- trapping instruction 2d: 83 e2 07 and $0x7,%edx 30: 0f b6 00 movzbl (%rax),%eax 33: 38 d0 cmp %dl,%al 35: 7f 08 jg 0x3f 37: 84 c0 test %al,%al 39: 0f 85 4b 02 00 00 jne 0x28a 3f: 41 rex.B