xpad 5-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 5-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19 ================================================================== BUG: KASAN: use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock+0x235/0x280 kernel/locking/spinlock_debug.c:114 Read of size 4 at addr ffff88805edb305c by task udevd/4841 CPU: 1 PID: 4841 Comm: udevd Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x235/0x280 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline] _raw_spin_lock_irqsave+0xb0/0xf0 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:137 [inline] __wake_up+0xed/0x180 kernel/sched/wait.c:157 __usb_hcd_giveback_urb+0x396/0x520 drivers/usb/core/hcd.c:1677 dummy_timer+0x827/0x2e10 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x16c/0x530 kernel/time/timer.c:1451 expire_timers kernel/time/timer.c:1496 [inline] __run_timers+0x525/0x7c0 kernel/time/timer.c:1767 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1780 handle_softirqs+0x328/0x820 kernel/softirq.c:576 __do_softirq kernel/softirq.c:610 [inline] invoke_softirq kernel/softirq.c:450 [inline] __irq_exit_rcu+0x12f/0x220 kernel/softirq.c:659 irq_exit_rcu+0x5/0x20 kernel/softirq.c:671 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline] sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676 RIP: 0010:do_mprotect_pkey+0x689/0x910 mm/mprotect.c:642 Code: c2 c8 ff 85 ed 0f 85 ee 00 00 00 4c 8b 6c 24 40 49 8d 5d 08 48 89 d8 48 c1 e8 03 49 be 00 00 00 00 00 fc ff df 42 80 3c 30 00 <74> 08 48 89 df e8 dd 26 0d 00 4c 8b 3b 4d 39 fc 4d 0f 47 fc 4c 89 RSP: 0018:ffffc90003ddfe70 EFLAGS: 00000246 RAX: 1ffff1100a523022 RBX: ffff888052918110 RCX: ffff88805e7e8000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: dffffc0000000000 R09: fffffbfff1ad33c4 R10: fffffbfff1ad33c4 R11: 1ffffffff1ad33c3 R12: 00007fa0448e9000 R13: ffff888052918108 R14: dffffc0000000000 R15: 00007fa0448e9000 __do_sys_mprotect mm/mprotect.c:662 [inline] __se_sys_mprotect mm/mprotect.c:659 [inline] __x64_sys_mprotect+0x7c/0x90 mm/mprotect.c:659 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fa0453bcfe7 Code: ef e8 3d fa ff ff 84 c0 75 b9 31 db 48 83 c4 08 48 89 d8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 44 00 00 b8 0a 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 2d 0d 00 f7 d8 64 89 01 48 RSP: 002b:00007ffd443720b8 EFLAGS: 00000246 ORIG_RAX: 000000000000000a RAX: ffffffffffffffda RBX: 0000000000000200 RCX: 00007fa0453bcfe7 RDX: 0000000000000001 RSI: 0000000000000200 RDI: 00007fa0448e8000 RBP: 00005599ac7ccba0 R08: 0000000000000000 R09: 0000000000000200 R10: 00005599ac7ccc00 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000080000 R14: 00005599ac7e1d98 R15: 00007fa045a9c39c Allocated by task 17938: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:735 [inline] xpad_probe+0x3f6/0x1b20 drivers/input/joystick/xpad.c:1790 usb_probe_interface+0x5a0/0xaf0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x284/0xc80 drivers/base/dd.c:595 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755 driver_probe_device+0x4f/0x420 drivers/base/dd.c:785 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429 __device_attach+0x29b/0x460 drivers/base/dd.c:979 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489 device_add+0xa00/0xfb0 drivers/base/core.c:3412 usb_set_configuration+0x1991/0x1fd0 drivers/usb/core/message.c:2165 usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238 usb_probe_device+0x139/0x270 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x284/0xc80 drivers/base/dd.c:595 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755 driver_probe_device+0x4f/0x420 drivers/base/dd.c:785 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429 __device_attach+0x29b/0x460 drivers/base/dd.c:979 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489 device_add+0xa00/0xfb0 drivers/base/core.c:3412 usb_new_device+0xd53/0x1640 drivers/usb/core/hub.c:2632 hub_port_connect drivers/usb/core/hub.c:5497 [inline] hub_port_connect_change drivers/usb/core/hub.c:5637 [inline] port_event drivers/usb/core/hub.c:5799 [inline] hub_event+0x2dd9/0x5560 drivers/usb/core/hub.c:5881 process_one_work+0x863/0x1000 kernel/workqueue.c:2310 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Freed by task 24445: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1710 [inline] slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736 slab_free mm/slub.c:3504 [inline] kfree+0xef/0x2a0 mm/slub.c:4564 xpad_disconnect+0x34c/0x470 drivers/input/joystick/xpad.c:1938 usb_unbind_interface+0x1ee/0x860 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1229 [inline] device_release_driver_internal+0x4b4/0x750 drivers/base/dd.c:1262 bus_remove_device+0x2e2/0x400 drivers/base/bus.c:531 device_del+0x628/0xa70 drivers/base/core.c:3600 usb_disable_device+0x3e2/0x890 drivers/usb/core/message.c:1414 usb_disconnect+0x348/0x8a0 drivers/usb/core/hub.c:2287 hub_port_connect drivers/usb/core/hub.c:5341 [inline] hub_port_connect_change drivers/usb/core/hub.c:5637 [inline] port_event drivers/usb/core/hub.c:5799 [inline] hub_event+0x1e9f/0x5560 drivers/usb/core/hub.c:5881 process_one_work+0x863/0x1000 kernel/workqueue.c:2310 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Last potentially related work creation: kasan_save_stack+0x35/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348 kvfree_call_rcu+0x10a/0x7c0 kernel/rcu/tree.c:3600 neigh_periodic_work+0x407/0xc70 net/core/neighbour.c:947 process_one_work+0x863/0x1000 kernel/workqueue.c:2310 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff88805edb3000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of 1024-byte region [ffff88805edb3000, ffff88805edb3400) The buggy address belongs to the page: page:ffffea00017b6c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5edb0 head:ffffea00017b6c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000500000001 ffff888016841dc0 raw: 0000000000000000 0000000000100010 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4172, ts 71547864203, free_ts 22475229593 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487 alloc_slab_page mm/slub.c:1780 [inline] allocate_slab mm/slub.c:1917 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1980 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3013 __slab_alloc mm/slub.c:3100 [inline] slab_alloc_node mm/slub.c:3191 [inline] __kmalloc_node_track_caller+0x1fc/0x3a0 mm/slub.c:4963 kmalloc_reserve net/core/skbuff.c:356 [inline] __alloc_skb+0x22c/0x750 net/core/skbuff.c:427 alloc_skb_fclone include/linux/skbuff.h:1212 [inline] sk_stream_alloc_skb+0x1fa/0xa60 net/ipv4/tcp.c:889 tcp_sendmsg_locked+0xc3e/0x3590 net/ipv4/tcp.c:1314 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] sock_write_iter+0x29c/0x380 net/socket.c:1079 call_write_iter include/linux/fs.h:2172 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x712/0xd00 fs/read_write.c:594 ksys_write+0x14d/0x250 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x94/0x280 mm/page_alloc.c:3396 free_contig_range+0x96/0xf0 mm/page_alloc.c:9406 destroy_args+0x100/0xa20 mm/debug_vm_pgtable.c:1018 debug_vm_pgtable+0x318/0x370 mm/debug_vm_pgtable.c:1336 do_one_initcall+0x1ee/0x680 init/main.c:1302 do_initcall_level+0x137/0x1f0 init/main.c:1375 do_initcalls+0x4b/0x90 init/main.c:1391 kernel_init_freeable+0x3ce/0x560 init/main.c:1615 kernel_init+0x19/0x1b0 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff88805edb2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805edb2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805edb3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805edb3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805edb3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: c2 c8 ff ret $0xffc8 3: 85 ed test %ebp,%ebp 5: 0f 85 ee 00 00 00 jne 0xf9 b: 4c 8b 6c 24 40 mov 0x40(%rsp),%r13 10: 49 8d 5d 08 lea 0x8(%r13),%rbx 14: 48 89 d8 mov %rbx,%rax 17: 48 c1 e8 03 shr $0x3,%rax 1b: 49 be 00 00 00 00 00 movabs $0xdffffc0000000000,%r14 22: fc ff df 25: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) * 2a: 74 08 je 0x34 <-- trapping instruction 2c: 48 89 df mov %rbx,%rdi 2f: e8 dd 26 0d 00 call 0xd2711 34: 4c 8b 3b mov (%rbx),%r15 37: 4d 39 fc cmp %r15,%r12 3a: 4d 0f 47 fc cmova %r12,%r15 3e: 4c rex.WR 3f: 89 .byte 0x89