xpad 4-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 4-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:86 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x26f/0x2b0 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff888058cce05c by task syz.0.840/9343 CPU: 0 UID: 0 PID: 9343 Comm: syz.0.840 Not tainted 6.16.0-rc5-syzkaller-00121-gbc9ff192a6c9 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xcd/0x680 mm/kasan/report.c:521 kasan_report+0xe0/0x110 mm/kasan/report.c:634 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x26f/0x2b0 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:105 [inline] __wake_up+0x1c/0x60 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+0x3b8/0x6e0 drivers/usb/core/hcd.c:1653 usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1734 dummy_timer+0x180e/0x3a20 drivers/usb/gadget/udc/dummy_hcd.c:1995 __run_hrtimer kernel/time/hrtimer.c:1761 [inline] __hrtimer_run_queues+0x202/0xad0 kernel/time/hrtimer.c:1825 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1842 handle_softirqs+0x219/0x8e0 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:preempt_schedule_irq+0x4c/0x90 kernel/sched/core.c:7113 Code: df 55 65 48 8b 2d 7c 48 47 08 53 48 89 eb 48 c1 eb 03 48 01 c3 bf 01 00 00 00 e8 6f 0a 00 f6 e8 0a 60 3a f6 fb bf 01 00 00 00 af 99 ff ff 9c 58 fa f6 c4 02 75 1e bf 01 00 00 00 e8 bd 91 ff RSP: 0000:ffffc9000404fe68 EFLAGS: 00000206 RAX: 0000000000008f2d RBX: ffffed100a735000 RCX: ffffffff81c3c6bf RDX: 0000000000000000 RSI: ffffffff8de329a6 RDI: 0000000000000001 RBP: ffff8880539a8000 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff90a98357 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 irqentry_exit+0x36/0x90 kernel/entry/common.c:307 asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:707 RIP: 0010:exit_to_user_mode_loop kernel/entry/common.c:101 [inline] RIP: 0010:exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline] RIP: 0010:irqentry_exit_to_user_mode+0x10b/0x270 kernel/entry/common.c:184 Code: 9c 58 fa f6 c4 02 0f 85 ea 00 00 00 e8 8e 0e 00 00 48 8b 5d 00 f7 c3 1e 30 02 00 0f 84 40 ff ff ff e8 49 91 3b f6 fb f6 c3 18 <75> bd f6 c7 10 74 c2 4c 89 e7 e8 c6 57 69 f6 f7 c3 04 00 02 00 74 RSP: 0000:ffffc9000404ff38 EFLAGS: 00000202 RAX: 0000000000008f2b RBX: 0000000000000008 RCX: ffffffff81c3c6bf RDX: 0000000000000000 RSI: ffffffff8de329a6 RDI: ffffffff8c158f60 RBP: ffff8880539a8000 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff90a98357 R11: 0000000000000001 R12: ffffc9000404ff58 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709 RIP: 0033:0x7fbb9f067dce Code: 89 34 24 48 89 ce 48 89 4f f8 49 8b 14 24 49 8b 4c 24 08 eb 85 0f 1f 80 00 00 00 00 48 89 fe 4c 89 ea 48 89 df e8 f2 fe ff ff <48> 89 d8 4c 29 e0 48 3d 80 00 00 00 7e 7f 4d 85 ed 74 24 48 89 df RSP: 002b:00007fff00ed1ab0 EFLAGS: 00000206 RAX: 0000000000000068 RBX: 00007fbb9e40e7d8 RCX: ffffffff8162f7e5 RDX: 0000000000000012 RSI: 00007fbb9e40e840 RDI: 00007fbb9e40e7d8 RBP: 00007fbb9e40e778 R08: 00007fbb9e40e7d8 R09: 00007fbb9f3a2000 R10: 00007fbb9e3fd008 R11: 0000000000000013 R12: 00007fbb9e40e770 R13: 0000000000000012 R14: 00007fff00ed1c98 R15: 00007fbb9e3fd008 Allocated by task 5890: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] xpad_probe+0x286/0x1ff0 drivers/input/joystick/xpad.c:2073 usb_probe_interface+0x300/0x9c0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:657 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:799 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:957 bus_for_each_drv+0x156/0x1e0 drivers/base/bus.c:462 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1029 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x1148/0x1a70 drivers/base/core.c:3692 usb_set_configuration+0x1187/0x1e20 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:250 usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:291 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:657 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:799 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:829 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:957 bus_for_each_drv+0x156/0x1e0 drivers/base/bus.c:462 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1029 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x1148/0x1a70 drivers/base/core.c:3692 usb_new_device+0xd07/0x1a20 drivers/usb/core/hub.c:2694 hub_port_connect drivers/usb/core/hub.c:5566 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5866 [inline] hub_event+0x2eb7/0x4fa0 drivers/usb/core/hub.c:5948 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402 kthread+0x3c5/0x780 kernel/kthread.c:464 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 2147: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2381 [inline] slab_free mm/slub.c:4643 [inline] kfree+0x2b4/0x4d0 mm/slub.c:4842 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2257 usb_unbind_interface+0x1dd/0x9a0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] device_remove+0x125/0x170 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1272 [inline] device_release_driver_internal+0x44b/0x620 drivers/base/dd.c:1295 bus_remove_device+0x22f/0x420 drivers/base/bus.c:579 device_del+0x396/0x9f0 drivers/base/core.c:3881 usb_disable_device+0x355/0x7d0 drivers/usb/core/message.c:1418 usb_disconnect+0x2e1/0x9c0 drivers/usb/core/hub.c:2344 hub_port_connect drivers/usb/core/hub.c:5406 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5866 [inline] hub_event+0x1c57/0x4fa0 drivers/usb/core/hub.c:5948 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402 kthread+0x3c5/0x780 kernel/kthread.c:464 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888058cce000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of freed 1024-byte region [ffff888058cce000, ffff888058cce400) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x58cc8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b841dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b841dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0001633201 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 3451, tgid 3451 (kworker/u8:8), ts 80779773606, free_ts 80726584760 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x1321/0x3890 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4959 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2419 alloc_slab_page mm/slub.c:2451 [inline] allocate_slab mm/slub.c:2619 [inline] new_slab+0x23b/0x330 mm/slub.c:2673 ___slab_alloc+0xd9c/0x1940 mm/slub.c:3859 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3949 __slab_alloc_node mm/slub.c:4024 [inline] slab_alloc_node mm/slub.c:4185 [inline] __do_kmalloc_node mm/slub.c:4327 [inline] __kmalloc_noprof+0x2f2/0x510 mm/slub.c:4340 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] ieee802_11_parse_elems_full+0x1d7/0x3780 net/mac80211/parse.c:1013 ieee802_11_parse_elems_crc net/mac80211/ieee80211_i.h:2414 [inline] ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2421 [inline] ieee80211_inform_bss+0x10b/0x1140 net/mac80211/scan.c:79 rdev_inform_bss net/wireless/rdev-ops.h:418 [inline] cfg80211_inform_single_bss_data+0x8ea/0x1df0 net/wireless/scan.c:2367 cfg80211_inform_bss_data+0x224/0x3bc0 net/wireless/scan.c:3222 cfg80211_inform_bss_frame_data+0x26f/0x750 net/wireless/scan.c:3313 ieee80211_bss_info_update+0x310/0xab0 net/mac80211/scan.c:226 ieee80211_scan_rx+0x4cf/0xb30 net/mac80211/scan.c:355 __ieee80211_rx_handle_packet net/mac80211/rx.c:5183 [inline] ieee80211_rx_list+0x1bdb/0x2980 net/mac80211/rx.c:5420 page last free pid 5204 tgid 5204 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0x7fe/0x1180 mm/page_alloc.c:2706 discard_slab mm/slub.c:2717 [inline] __put_partials+0x16d/0x1c0 mm/slub.c:3186 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4148 [inline] slab_alloc_node mm/slub.c:4197 [inline] __do_kmalloc_node mm/slub.c:4327 [inline] __kvmalloc_node_noprof+0x230/0x620 mm/slub.c:5015 seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x826/0x12c0 fs/seq_file.c:210 kernfs_fop_read_iter+0x40f/0x5a0 fs/kernfs/file.c:279 new_sync_read fs/read_write.c:491 [inline] vfs_read+0x8bf/0xc60 fs/read_write.c:572 ksys_read+0x12a/0x250 fs/read_write.c:715 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888058ccdf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888058ccdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888058cce000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888058cce080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888058cce100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: df 55 65 fists 0x65(%rbp) 3: 48 8b 2d 7c 48 47 08 mov 0x847487c(%rip),%rbp # 0x8474886 a: 53 push %rbx b: 48 89 eb mov %rbp,%rbx e: 48 c1 eb 03 shr $0x3,%rbx 12: 48 01 c3 add %rax,%rbx 15: bf 01 00 00 00 mov $0x1,%edi 1a: e8 6f 0a 00 f6 call 0xf6000a8e 1f: e8 0a 60 3a f6 call 0xf63a602e 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 af 99 ff ff call 0xffff99de <-- trapping instruction 2f: 9c pushf 30: 58 pop %rax 31: fa cli 32: f6 c4 02 test $0x2,%ah 35: 75 1e jne 0x55 37: bf 01 00 00 00 mov $0x1,%edi 3c: e8 .byte 0xe8 3d: bd .byte 0xbd 3e: 91 xchg %eax,%ecx 3f: ff .byte 0xff