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:86 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x23d/0x290 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff888030df585c by task syz-executor/5869 CPU: 0 UID: 0 PID: 5869 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x23d/0x290 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0xb3/0xf0 kernel/locking/spinlock.c:162 __wake_up_common_lock+0x2f/0x1f0 kernel/sched/wait.c:124 __usb_hcd_giveback_urb+0x3b0/0x540 drivers/usb/core/hcd.c:1664 dummy_timer+0x862/0x4550 drivers/usb/gadget/udc/dummy_hcd.c:1995 __run_hrtimer kernel/time/hrtimer.c:1761 [inline] __hrtimer_run_queues+0x529/0xc60 kernel/time/hrtimer.c:1825 hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1842 handle_softirqs+0x286/0x870 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:unwind_done arch/x86/include/asm/unwind.h:50 [inline] RIP: 0010:__unwind_start+0x5cf/0x760 arch/x86/kernel/unwind_orc.c:755 Code: 24 10 49 39 04 24 0f 87 1b fb ff ff 48 89 df e8 f7 d1 ff ff 48 be 00 00 00 00 00 fc ff df 48 8b 04 24 0f b6 04 30 84 c0 75 0e <83> 3b 00 0f 85 4a ff ff ff e9 ef fa ff ff 89 d9 80 e1 07 80 c1 03 RSP: 0018:ffffc900040cf8a8 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffffc900040cf908 RCX: 5050326362315d00 RDX: 0000000000000000 RSI: dffffc0000000000 RDI: ffff8880775f0000 RBP: 1ffff92000819f22 R08: ffffc900040cf990 R09: 0000000000000000 R10: ffffc900040cf958 R11: fffff52000819f2d R12: ffffc900040cf940 R13: ffffc900040cf918 R14: 1ffff92000819f23 R15: ffffc900040cf910 unwind_start arch/x86/include/asm/unwind.h:64 [inline] arch_stack_walk+0xe4/0x150 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:122 save_stack+0xf5/0x1f0 mm/page_owner.c:156 __reset_page_owner+0x71/0x1f0 mm/page_owner.c:308 reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2891 vfree+0x25a/0x400 mm/vmalloc.c:3434 bch2_fs_btree_write_buffer_exit+0x1ac/0x1e0 fs/bcachefs/btree_write_buffer.c:871 __bch2_fs_free fs/bcachefs/super.c:615 [inline] bch2_fs_release+0x297/0x830 fs/bcachefs/super.c:667 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x228/0x480 lib/kobject.c:737 deactivate_locked_super+0xbc/0x130 fs/super.c:473 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1393 task_work_run+0x1d4/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xec/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2bd/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc15ed8fed7 Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffc0eed0598 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 00007fc15ee11c05 RCX: 00007fc15ed8fed7 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffc0eed0650 RBP: 00007ffc0eed0650 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffc0eed16e0 R13: 00007fc15ee11c05 R14: 00000000000665dd R15: 00007ffc0eed1720 Allocated by task 5954: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:397 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:414 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x3d5/0x6f0 mm/slub.c:5397 kmalloc_noprof include/linux/slab.h:956 [inline] kzalloc_noprof include/linux/slab.h:1090 [inline] xpad_probe+0x428/0x1fc0 drivers/input/joystick/xpad.c:2075 usb_probe_interface+0x665/0xc30 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26d/0x9e0 drivers/base/dd.c:659 __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801 driver_probe_device+0x4f/0x430 drivers/base/dd.c:831 __device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462 __device_attach+0x2b8/0x400 drivers/base/dd.c:1031 bus_probe_device+0x185/0x260 drivers/base/bus.c:537 device_add+0x7b6/0xb50 drivers/base/core.c:3689 usb_set_configuration+0x1a87/0x20e0 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:250 usb_probe_device+0x1c1/0x390 drivers/usb/core/driver.c:291 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26d/0x9e0 drivers/base/dd.c:659 __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801 driver_probe_device+0x4f/0x430 drivers/base/dd.c:831 __device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462 __device_attach+0x2b8/0x400 drivers/base/dd.c:1031 bus_probe_device+0x185/0x260 drivers/base/bus.c:537 device_add+0x7b6/0xb50 drivers/base/core.c:3689 usb_new_device+0xa39/0x16f0 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:5870 [inline] hub_event+0x2958/0x4a20 drivers/usb/core/hub.c:5952 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x47c/0x820 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 5926: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5b/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2484 [inline] slab_free mm/slub.c:6121 [inline] kfree+0x199/0x6d0 mm/slub.c:6329 xpad_disconnect+0x350/0x480 drivers/input/joystick/xpad.c:2259 usb_unbind_interface+0x26e/0x910 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:571 [inline] __device_release_driver drivers/base/dd.c:1274 [inline] device_release_driver_internal+0x4d9/0x800 drivers/base/dd.c:1297 bus_remove_device+0x34d/0x410 drivers/base/bus.c:579 device_del+0x511/0x8e0 drivers/base/core.c:3878 usb_disable_device+0x3e9/0x8a0 drivers/usb/core/message.c:1418 usb_disconnect+0x330/0x950 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:5870 [inline] hub_event+0x1cf5/0x4a20 drivers/usb/core/hub.c:5952 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x47c/0x820 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888030df5800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of freed 1024-byte region [ffff888030df5800, ffff888030df5c00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x30df0 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 ffff88801a841dc0 ffffea000148c600 dead000000000002 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801a841dc0 ffffea000148c600 dead000000000002 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0000c37c01 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 12, tgid 12 (kworker/u8:0), ts 106164514249, free_ts 106149626027 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3854 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5144 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2996 [inline] allocate_slab+0x8a/0x330 mm/slub.c:3164 new_slab mm/slub.c:3218 [inline] ___slab_alloc+0xbd1/0x13f0 mm/slub.c:4420 __slab_alloc+0x55/0xa0 mm/slub.c:4511 __slab_alloc_node mm/slub.c:4586 [inline] slab_alloc_node mm/slub.c:4996 [inline] __do_kmalloc_node mm/slub.c:5365 [inline] __kmalloc_noprof+0x471/0x7f0 mm/slub.c:5378 kmalloc_noprof include/linux/slab.h:960 [inline] kzalloc_noprof include/linux/slab.h:1090 [inline] ieee802_11_parse_elems_full+0x152/0x2ab0 net/mac80211/parse.c:1011 ieee802_11_parse_elems_crc net/mac80211/ieee80211_i.h:2470 [inline] ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2477 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1569 [inline] ieee80211_ibss_rx_queued_mgmt+0x462/0x2ae0 net/mac80211/ibss.c:1600 ieee80211_iface_process_skb net/mac80211/iface.c:1699 [inline] ieee80211_iface_work+0x85f/0x12d0 net/mac80211/iface.c:1753 cfg80211_wiphy_work+0x2bb/0x470 net/wireless/core.c:435 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x47c/0x820 arch/x86/kernel/process.c:158 page last free pid 5847 tgid 5847 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2891 skb_release_data+0x62d/0x7c0 net/core/skbuff.c:1086 skb_release_all net/core/skbuff.c:1151 [inline] __napi_kfree_skb net/core/skbuff.c:1441 [inline] kfree_skb_napi_cache net/core/skbuff.c:7169 [inline] skb_attempt_defer_free+0x422/0x5c0 net/core/skbuff.c:7191 tcp_eat_recv_skb net/ipv4/tcp.c:1562 [inline] tcp_recvmsg_locked+0x248f/0x3660 net/ipv4/tcp.c:2859 tcp_recvmsg+0x216/0x810 net/ipv4/tcp.c:2905 inet_recvmsg+0x147/0x250 net/ipv4/af_inet.c:883 sock_recvmsg_nosec net/socket.c:1065 [inline] sock_recvmsg+0x1a8/0x270 net/socket.c:1087 sock_read_iter+0x231/0x2f0 net/socket.c:1157 new_sync_read fs/read_write.c:491 [inline] vfs_read+0x55a/0xa30 fs/read_write.c:572 ksys_read+0x145/0x250 fs/read_write.c:715 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888030df5700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888030df5780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888030df5800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888030df5880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888030df5900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 24 10 and $0x10,%al 2: 49 39 04 24 cmp %rax,(%r12) 6: 0f 87 1b fb ff ff ja 0xfffffb27 c: 48 89 df mov %rbx,%rdi f: e8 f7 d1 ff ff call 0xffffd20b 14: 48 be 00 00 00 00 00 movabs $0xdffffc0000000000,%rsi 1b: fc ff df 1e: 48 8b 04 24 mov (%rsp),%rax 22: 0f b6 04 30 movzbl (%rax,%rsi,1),%eax 26: 84 c0 test %al,%al 28: 75 0e jne 0x38 * 2a: 83 3b 00 cmpl $0x0,(%rbx) <-- trapping instruction 2d: 0f 85 4a ff ff ff jne 0xffffff7d 33: e9 ef fa ff ff jmp 0xfffffb27 38: 89 d9 mov %ebx,%ecx 3a: 80 e1 07 and $0x7,%cl 3d: 80 c1 03 add $0x3,%cl