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 register_lock_class+0x1033/0x1240 kernel/locking/lockdep.c:1343 Read of size 1 at addr ffff88802780a091 by task syz.4.1413/11490 CPU: 1 UID: 0 PID: 11490 Comm: syz.4.1413 Not tainted 6.14.0-rc5-syzkaller-00268-g1110ce6a1e34 #0 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+0xd9/0x110 mm/kasan/report.c:634 register_lock_class+0x1033/0x1240 kernel/locking/lockdep.c:1343 __lock_acquire+0x135/0x3c40 kernel/locking/lockdep.c:5103 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/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+0x3b7/0x6e0 drivers/usb/core/hcd.c:1653 usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1734 dummy_timer+0x17f7/0x3960 drivers/usb/gadget/udc/dummy_hcd.c:1994 __run_hrtimer kernel/time/hrtimer.c:1801 [inline] __hrtimer_run_queues+0x20a/0xae0 kernel/time/hrtimer.c:1865 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1882 handle_softirqs+0x213/0x8f0 kernel/softirq.c:561 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 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:__kasan_unpoison_pages+0x0/0x50 mm/kasan/common.c:119 Code: fe 31 d2 48 81 e7 00 80 ff ff 81 e6 ff 7f 00 00 e9 25 3e 00 00 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 <66> 0f 1f 00 48 b8 00 00 00 00 00 16 00 00 89 f1 0f b6 d2 48 01 c7 RSP: 0018:ffffc90003f87048 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: ffffea0001248080 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffffea0001248080 RBP: 0000000000140cca R08: 0000000000001000 R09: 00000000000ff000 R10: ffffffff96ec5cff R11: dffffc0000000000 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000001 kasan_unpoison_pages include/linux/kasan.h:125 [inline] post_alloc_hook+0x90/0x1b0 mm/page_alloc.c:1535 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4740 alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270 folio_alloc_mpol_noprof+0x36/0x2f0 mm/mempolicy.c:2289 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1863 shmem_alloc_and_add_folio+0x48e/0xc10 mm/shmem.c:1902 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2545 shmem_fault+0x200/0xae0 mm/shmem.c:2746 __do_fault+0x10a/0x490 mm/memory.c:4990 do_read_fault mm/memory.c:5410 [inline] do_fault mm/memory.c:5544 [inline] do_pte_missing+0xecf/0x3e10 mm/memory.c:4060 handle_pte_fault mm/memory.c:5907 [inline] __handle_mm_fault+0x1166/0x2c60 mm/memory.c:6050 handle_mm_fault+0x3fa/0xaa0 mm/memory.c:6219 faultin_page mm/gup.c:1196 [inline] __get_user_pages+0x773/0x36f0 mm/gup.c:1491 populate_vma_page_range+0x27f/0x3a0 mm/gup.c:1929 __mm_populate+0x1d6/0x380 mm/gup.c:2032 mm_populate include/linux/mm.h:3386 [inline] vm_mmap_pgoff+0x2d3/0x3a0 mm/util.c:580 ksys_mmap_pgoff+0x7d/0x5c0 mm/mmap.c:607 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe104b8d169 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe10591f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007fe104da5fa0 RCX: 00007fe104b8d169 RDX: b635773f06ebbeee RSI: 0000000000b36000 RDI: 0000400000000000 RBP: 00007fe104c0e2a0 R08: ffffffffffffffff R09: 0000000000000000 R10: 0000000000008031 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe104da5fa0 R15: 00007ffdfa9b9268 Allocated by task 8206: 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:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] xpad_probe+0x27e/0x1f50 drivers/input/joystick/xpad.c:2006 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+0x157/0x1e0 drivers/base/bus.c:462 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x114b/0x1a70 drivers/base/core.c:3665 usb_set_configuration+0x10cb/0x1c50 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+0x157/0x1e0 drivers/base/bus.c:462 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537 device_add+0x114b/0x1a70 drivers/base/core.c:3665 usb_new_device+0xd09/0x1a20 drivers/usb/core/hub.c:2663 hub_port_connect drivers/usb/core/hub.c:5533 [inline] hub_port_connect_change drivers/usb/core/hub.c:5673 [inline] port_event drivers/usb/core/hub.c:5833 [inline] hub_event+0x2d9a/0x4e10 drivers/usb/core/hub.c:5915 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 8195: 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:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4757 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2187 usb_unbind_interface+0x1e2/0x960 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+0x44a/0x610 drivers/base/dd.c:1296 bus_remove_device+0x22f/0x420 drivers/base/bus.c:579 device_del+0x396/0x9f0 drivers/base/core.c:3854 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418 usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2316 hub_port_connect drivers/usb/core/hub.c:5373 [inline] hub_port_connect_change drivers/usb/core/hub.c:5673 [inline] port_event drivers/usb/core/hub.c:5833 [inline] hub_event+0x1da5/0x4e10 drivers/usb/core/hub.c:5915 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88802780a000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of freed 1024-byte region [ffff88802780a000, ffff88802780a400) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27808 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 ffff88801b041dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b041dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea00009e0201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5904, tgid 5904 (kworker/1:6), ts 69217551641, free_ts 69195750928 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4740 alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2587 [inline] new_slab+0x23d/0x330 mm/slub.c:2640 ___slab_alloc+0xc5d/0x1720 mm/slub.c:3826 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_noprof+0x2ec/0x510 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] neigh_alloc net/core/neighbour.c:473 [inline] ___neigh_create+0x14ee/0x28e0 net/core/neighbour.c:607 ip6_finish_output2+0x130c/0x20a0 net/ipv6/ip6_output.c:132 __ip6_finish_output net/ipv6/ip6_output.c:215 [inline] ip6_finish_output+0x3f9/0x1360 net/ipv6/ip6_output.c:226 NF_HOOK_COND include/linux/netfilter.h:303 [inline] ip6_output+0x1f8/0x540 net/ipv6/ip6_output.c:247 dst_output include/net/dst.h:459 [inline] NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] mld_sendpack+0x9f0/0x11d0 net/ipv6/mcast.c:1868 mld_send_cr net/ipv6/mcast.c:2169 [inline] mld_ifc_work+0x740/0xca0 net/ipv6/mcast.c:2702 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400 page last free pid 5982 tgid 5969 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0x6db/0xfb0 mm/page_alloc.c:2660 __folio_put+0x32a/0x450 mm/swap.c:112 folio_put include/linux/mm.h:1489 [inline] put_page+0x21e/0x280 include/linux/mm.h:1561 page_to_skb+0x79b/0xa20 drivers/net/virtio_net.c:914 receive_mergeable drivers/net/virtio_net.c:2434 [inline] receive_buf+0x759/0x30b0 drivers/net/virtio_net.c:2572 virtnet_receive_packets drivers/net/virtio_net.c:2887 [inline] virtnet_receive drivers/net/virtio_net.c:2911 [inline] virtnet_poll+0xfe5/0x39f0 drivers/net/virtio_net.c:3006 __napi_poll.constprop.0+0xb7/0x550 net/core/dev.c:7188 napi_poll net/core/dev.c:7257 [inline] net_rx_action+0xa94/0x1010 net/core/dev.c:7379 handle_softirqs+0x213/0x8f0 kernel/softirq.c:561 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 common_interrupt+0xbf/0xe0 arch/x86/kernel/irq.c:280 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 Memory state around the buggy address: ffff888027809f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802780a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802780a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802780a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802780a180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 31 d2 xor %edx,%edx 2: 48 81 e7 00 80 ff ff and $0xffffffffffff8000,%rdi 9: 81 e6 ff 7f 00 00 and $0x7fff,%esi f: e9 25 3e 00 00 jmp 0x3e39 14: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 90 nop 1f: 90 nop 20: 90 nop 21: 90 nop 22: 90 nop 23: 90 nop 24: 90 nop 25: 90 nop 26: 90 nop 27: 90 nop 28: 90 nop * 29: 66 0f 1f 00 nopw (%rax) <-- trapping instruction 2d: 48 b8 00 00 00 00 00 movabs $0x160000000000,%rax 34: 16 00 00 37: 89 f1 mov %esi,%ecx 39: 0f b6 d2 movzbl %dl,%edx 3c: 48 01 c7 add %rax,%rdi