xpad 1-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 1-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 ffff8881457be85c by task swapper/0/0 CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.15.0-rc3-syzkaller-00019-gbc3372351d0c #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/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+0xc3/0x670 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:1994 __run_hrtimer kernel/time/hrtimer.c:1761 [inline] __hrtimer_run_queues+0x1ff/0xad0 kernel/time/hrtimer.c:1825 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1842 handle_softirqs+0x216/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:1049 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:pv_native_safe_halt+0xf/0x20 arch/x86/kernel/paravirt.c:81 Code: 25 5d 02 c3 cc cc cc cc 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 66 90 0f 00 2d b3 3a 17 00 fb f4 cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90 RSP: 0018:ffffffff8e007e10 EFLAGS: 000002c6 RAX: 0000000000eb5ab1 RBX: 0000000000000000 RCX: ffffffff8b72b419 RDX: 0000000000000000 RSI: ffffffff8dbef846 RDI: ffffffff8bf465c0 RBP: fffffbfff1c12ee8 R08: 0000000000000001 R09: ffffed10170865bd R10: ffff8880b8432deb R11: 0000000000000000 R12: 0000000000000000 R13: ffffffff8e097740 R14: ffffffff90864910 R15: 0000000000000000 arch_safe_halt arch/x86/include/asm/paravirt.h:107 [inline] default_idle+0x13/0x20 arch/x86/kernel/process.c:748 default_idle_call+0x6d/0xb0 kernel/sched/idle.c:117 cpuidle_idle_call kernel/sched/idle.c:185 [inline] do_idle+0x391/0x510 kernel/sched/idle.c:325 cpu_startup_entry+0x4f/0x60 kernel/sched/idle.c:423 rest_init+0x16b/0x2b0 init/main.c:743 start_kernel+0x3e9/0x4d0 init/main.c:1099 x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:513 x86_64_start_kernel+0xb0/0xc0 arch/x86/kernel/head64.c:494 common_startup_64+0x13e/0x148 Allocated by task 9: 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/0x1f30 drivers/input/joystick/xpad.c:2031 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:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x156/0x1e0 drivers/base/bus.c:462 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x1148/0x1a70 drivers/base/core.c:3666 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:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x156/0x1e0 drivers/base/bus.c:462 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x1148/0x1a70 drivers/base/core.c:3666 usb_new_device+0xd07/0x1a20 drivers/usb/core/hub.c:2663 hub_port_connect drivers/usb/core/hub.c:5531 [inline] hub_port_connect_change drivers/usb/core/hub.c:5671 [inline] port_event drivers/usb/core/hub.c:5831 [inline] hub_event+0x2eb7/0x4fa0 drivers/usb/core/hub.c:5913 process_one_work+0x9cc/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400 kthread+0x3c2/0x780 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 5931: 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:2398 [inline] slab_free mm/slub.c:4656 [inline] kfree+0x2b6/0x4d0 mm/slub.c:4855 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2212 usb_unbind_interface+0x1da/0x9a0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] device_remove+0x122/0x170 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1273 [inline] device_release_driver_internal+0x44b/0x620 drivers/base/dd.c:1296 bus_remove_device+0x22f/0x420 drivers/base/bus.c:579 device_del+0x396/0x9f0 drivers/base/core.c:3855 usb_disable_device+0x355/0x7d0 drivers/usb/core/message.c:1418 usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2316 hub_port_connect drivers/usb/core/hub.c:5371 [inline] hub_port_connect_change drivers/usb/core/hub.c:5671 [inline] port_event drivers/usb/core/hub.c:5831 [inline] hub_event+0x1c57/0x4fa0 drivers/usb/core/hub.c:5913 process_one_work+0x9cc/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400 kthread+0x3c2/0x780 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff8881457be800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of freed 1024-byte region [ffff8881457be800, ffff8881457bec00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1457b8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 057ff00000000040 ffff88801b441dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 057ff00000000040 ffff88801b441dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 057ff00000000003 ffffea000515ee01 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5833, tgid 5833 (syz-executor), ts 65294806628, free_ts 29922791400 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x135c/0x3920 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x263/0x23a0 mm/page_alloc.c:4970 alloc_slab_page mm/slub.c:2470 [inline] allocate_slab mm/slub.c:2632 [inline] new_slab+0x94/0x340 mm/slub.c:2686 ___slab_alloc+0xd9c/0x1940 mm/slub.c:3872 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3962 __slab_alloc_node mm/slub.c:4037 [inline] slab_alloc_node mm/slub.c:4198 [inline] __kmalloc_cache_node_noprof+0x100/0x420 mm/slub.c:4380 kmalloc_node_noprof include/linux/slab.h:928 [inline] shrinker_unit_alloc mm/shrinker.c:50 [inline] alloc_shrinker_info+0x18c/0x470 mm/shrinker.c:90 mem_cgroup_css_online+0x217/0x640 mm/memcontrol.c:3730 online_css+0xaf/0x350 kernel/cgroup/cgroup.c:5607 css_create kernel/cgroup/cgroup.c:5691 [inline] cgroup_apply_control_enable+0x6cd/0xc70 kernel/cgroup/cgroup.c:3282 cgroup_mkdir+0x39a/0x1160 kernel/cgroup/cgroup.c:5886 kernfs_iop_mkdir+0x108/0x190 fs/kernfs/dir.c:1266 vfs_mkdir+0x590/0x8c0 fs/namei.c:4359 do_mkdirat+0x304/0x3e0 fs/namei.c:4392 __do_sys_mkdirat fs/namei.c:4409 [inline] __se_sys_mkdirat fs/namei.c:4407 [inline] __x64_sys_mkdirat+0x83/0xb0 fs/namei.c:4407 page last free pid 5206 tgid 5206 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0x69d/0xff0 mm/page_alloc.c:2725 discard_slab mm/slub.c:2730 [inline] __put_partials+0x16d/0x1c0 mm/slub.c:3199 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/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:4161 [inline] slab_alloc_node mm/slub.c:4210 [inline] __kmalloc_cache_noprof+0x1f1/0x3e0 mm/slub.c:4367 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] kernfs_fop_open+0x244/0xda0 fs/kernfs/file.c:623 do_dentry_open+0x741/0x1c10 fs/open.c:956 vfs_open+0x82/0x3f0 fs/open.c:1086 do_open fs/namei.c:3880 [inline] path_openat+0x1e5e/0x2d40 fs/namei.c:4039 do_filp_open+0x20b/0x470 fs/namei.c:4066 do_sys_openat2+0x11b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_openat fs/open.c:1460 [inline] __se_sys_openat fs/open.c:1455 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1455 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8881457be700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881457be780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881457be800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881457be880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881457be900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 25 5d 02 c3 cc and $0xccc3025d,%eax 5: cc int3 6: cc int3 7: cc int3 8: 0f 1f 00 nopl (%rax) b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: f3 0f 1e fa endbr64 1f: 66 90 xchg %ax,%ax 21: 0f 00 2d b3 3a 17 00 verw 0x173ab3(%rip) # 0x173adb 28: fb sti 29: f4 hlt * 2a: c3 ret <-- trapping instruction 2b: cc int3 2c: cc int3 2d: cc int3 2e: cc int3 2f: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 36: 00 00 00 39: 66 90 xchg %ax,%ax 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 90 nop 3f: 90 nop