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 register_lock_class+0x1033/0x1240 kernel/locking/lockdep.c:1341 Read of size 1 at addr ffff88807bd0a891 by task syz-executor/9400 CPU: 0 UID: 0 PID: 9400 Comm: syz-executor Not tainted 6.12.0-rc3-syzkaller-00087-gc964ced77262 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 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:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 register_lock_class+0x1033/0x1240 kernel/locking/lockdep.c:1341 __lock_acquire+0x135/0x3ce0 kernel/locking/lockdep.c:5077 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 __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+0x17c3/0x38d0 drivers/usb/gadget/udc/dummy_hcd.c:1988 __run_hrtimer kernel/time/hrtimer.c:1691 [inline] __hrtimer_run_queues+0x20a/0xae0 kernel/time/hrtimer.c:1755 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1772 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1037 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:__sanitizer_cov_trace_pc+0x66/0x70 kernel/kcov.c:235 Code: 82 f8 15 00 00 83 f8 02 75 20 48 8b 8a 00 16 00 00 8b 92 fc 15 00 00 48 8b 01 48 83 c0 01 48 39 d0 73 07 48 89 01 48 89 34 c1 cc cc cc cc 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90003e77598 EFLAGS: 00000293 RAX: 0000000000000000 RBX: ffffea00009f1840 RCX: ffffffff81faebf2 RDX: ffff888032838000 RSI: ffffffff81faec23 RDI: 0000000000000007 RBP: ffff88801c66de50 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000000 R15: dffffc0000000000 page_ext_data include/linux/page_ext.h:86 [inline] get_page_table_check mm/page_table_check.c:56 [inline] page_table_check_set mm/page_table_check.c:123 [inline] page_table_check_set+0x3c3/0x9c0 mm/page_table_check.c:102 __page_table_check_ptes_set+0x2d0/0x3e0 mm/page_table_check.c:225 page_table_check_ptes_set include/linux/page_table_check.h:74 [inline] set_ptes include/linux/pgtable.h:267 [inline] __copy_present_ptes mm/memory.c:969 [inline] copy_present_ptes+0xb79/0x3930 mm/memory.c:1052 copy_pte_range mm/memory.c:1167 [inline] copy_pmd_range mm/memory.c:1255 [inline] copy_pud_range mm/memory.c:1292 [inline] copy_p4d_range mm/memory.c:1316 [inline] copy_page_range+0xea2/0x4f40 mm/memory.c:1414 dup_mmap kernel/fork.c:750 [inline] dup_mm kernel/fork.c:1674 [inline] copy_mm kernel/fork.c:1723 [inline] copy_process+0x7dcb/0x8db0 kernel/fork.c:2372 kernel_clone+0xfd/0x960 kernel/fork.c:2784 __do_sys_clone+0xba/0x100 kernel/fork.c:2927 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:0x7ff5a1174853 Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00 RSP: 002b:00007ffca082f908 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff5a1174853 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 0000555560a167d0 R11: 0000000000000246 R12: 0000000000000000 R13: 00000000001095c7 R14: 0000000000108b1f R15: 00007ffca082fa90 Allocated by task 8: 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:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] xpad_probe+0x27e/0x1f50 drivers/input/joystick/xpad.c:2026 usb_probe_interface+0x309/0x9d0 drivers/usb/core/driver.c:399 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:459 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534 device_add+0x114b/0x1a70 drivers/base/core.c:3675 usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:254 usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:294 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:459 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:534 device_add+0x114b/0x1a70 drivers/base/core.c:3675 usb_new_device+0xd90/0x1a10 drivers/usb/core/hub.c:2651 hub_port_connect drivers/usb/core/hub.c:5521 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x2d9a/0x4e10 drivers/usb/core/hub.c:5903 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 25: 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:579 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:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x14f/0x4b0 mm/slub.c:4727 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2207 usb_unbind_interface+0x1e8/0x970 drivers/usb/core/driver.c:461 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:576 device_del+0x396/0x9f0 drivers/base/core.c:3864 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418 usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5361 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x1da5/0x4e10 drivers/usb/core/hub.c:5903 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88807bd0a800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of freed 1024-byte region [ffff88807bd0a800, ffff88807bd0ac00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7bd08 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 ffffea0001217c00 dead000000000002 raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801b041dc0 ffffea0001217c00 dead000000000002 head: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea0001ef4201 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5220, tgid 5220 (syz-executor), ts 93121067112, free_ts 92999170189 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x101e/0x3070 mm/page_alloc.c:3457 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2ba/0x3f0 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_node_noprof+0x357/0x430 mm/slub.c:4270 kmalloc_node_noprof include/linux/slab.h:905 [inline] qdisc_alloc+0xbb/0xc50 net/sched/sch_generic.c:946 qdisc_create_dflt+0x73/0x440 net/sched/sch_generic.c:1008 attach_one_default_qdisc net/sched/sch_generic.c:1174 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2504 [inline] attach_default_qdiscs net/sched/sch_generic.c:1192 [inline] dev_activate+0x63a/0x12b0 net/sched/sch_generic.c:1251 __dev_open+0x396/0x4e0 net/core/dev.c:1485 __dev_change_flags+0x561/0x720 net/core/dev.c:8841 dev_change_flags+0x8f/0x160 net/core/dev.c:8913 devinet_ioctl+0x113d/0x1e20 net/ipv4/devinet.c:1173 inet_ioctl+0x3aa/0x3f0 net/ipv4/af_inet.c:1003 page last free pid 5305 tgid 5305 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2638 __put_partials+0x14c/0x170 mm/slub.c:3145 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141 vm_area_alloc+0x1f/0x230 kernel/fork.c:472 mmap_region+0xf22/0x2a60 mm/mmap.c:1424 do_mmap+0xc00/0xfc0 mm/mmap.c:496 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:588 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:542 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 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 Memory state around the buggy address: ffff88807bd0a780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807bd0a800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807bd0a880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807bd0a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807bd0a980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: f8 clc 1: 15 00 00 83 f8 adc $0xf8830000,%eax 6: 02 75 20 add 0x20(%rbp),%dh 9: 48 8b 8a 00 16 00 00 mov 0x1600(%rdx),%rcx 10: 8b 92 fc 15 00 00 mov 0x15fc(%rdx),%edx 16: 48 8b 01 mov (%rcx),%rax 19: 48 83 c0 01 add $0x1,%rax 1d: 48 39 d0 cmp %rdx,%rax 20: 73 07 jae 0x29 22: 48 89 01 mov %rax,(%rcx) 25: 48 89 34 c1 mov %rsi,(%rcx,%rax,8) * 29: c3 ret <-- trapping instruction 2a: cc int3 2b: cc int3 2c: cc int3 2d: cc int3 2e: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 33: 90 nop 34: 90 nop 35: 90 nop 36: 90 nop 37: 90 nop 38: 90 nop 39: 90 nop 3a: 90 nop 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 90 nop