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: slab-use-after-free in register_lock_class+0x8db/0x980 kernel/locking/lockdep.c:1341 Read of size 1 at addr ffff888035519091 by task syz.6.290/7432 CPU: 0 UID: 0 PID: 7432 Comm: syz.6.290 Not tainted 6.13.0-rc1-syzkaller-00337-g7503345ac5f5 #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+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 register_lock_class+0x8db/0x980 kernel/locking/lockdep.c:1341 __lock_acquire+0xf3/0x2100 kernel/locking/lockdep.c:5101 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 __wake_up_common_lock+0x25/0x1e0 kernel/sched/wait.c:105 __usb_hcd_giveback_urb+0x4ff/0x6e0 drivers/usb/core/hcd.c:1653 dummy_timer+0x856/0x4620 drivers/usb/gadget/udc/dummy_hcd.c:1993 __run_hrtimer kernel/time/hrtimer.c:1739 [inline] __hrtimer_run_queues+0x59b/0xd30 kernel/time/hrtimer.c:1803 hrtimer_run_softirq+0x19a/0x2c0 kernel/time/hrtimer.c:1820 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:655 irq_exit_rcu+0x9/0x30 kernel/softirq.c:671 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:csd_lock_wait kernel/smp.c:340 [inline] RIP: 0010:smp_call_function_many_cond+0x19f3/0x2c60 kernel/smp.c:884 Code: 45 8b 65 00 44 89 e6 83 e6 01 31 ff e8 56 e9 0b 00 41 83 e4 01 49 bc 00 00 00 00 00 fc ff df 75 07 e8 01 e5 0b 00 eb 38 f3 90 <42> 0f b6 04 23 84 c0 75 11 41 f7 45 00 01 00 00 00 74 1e e8 e5 e4 RSP: 0018:ffffc900030ff900 EFLAGS: 00000293 RAX: ffffffff81938d2b RBX: 1ffff110170e88e9 RCX: ffff88802f0d5a00 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffc900030ffb00 R08: ffffffff81938cfa R09: 1ffffffff2857510 R10: dffffc0000000000 R11: fffffbfff2857511 R12: dffffc0000000000 R13: ffff8880b8744748 R14: ffff8880b863fac0 R15: 0000000000000001 on_each_cpu_cond_mask+0x3f/0x80 kernel/smp.c:1051 on_each_cpu include/linux/smp.h:71 [inline] text_poke_sync arch/x86/kernel/alternative.c:2114 [inline] text_poke_bp_batch+0x352/0xb30 arch/x86/kernel/alternative.c:2324 text_poke_flush arch/x86/kernel/alternative.c:2515 [inline] text_poke_finish+0x30/0x50 arch/x86/kernel/alternative.c:2522 arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146 __static_key_slow_dec_cpuslocked+0xc4/0x110 kernel/jump_label.c:315 __static_key_slow_dec kernel/jump_label.c:321 [inline] static_key_slow_dec+0x51/0xa0 kernel/jump_label.c:336 kvm_destroy_vm virt/kvm/kvm_main.c:1316 [inline] kvm_put_kvm+0xd6a/0xf60 virt/kvm/kvm_main.c:1340 kvm_vm_release+0x43/0x50 virt/kvm/kvm_main.c:1363 __fput+0x23c/0xa50 fs/file_table.c:450 task_work_run+0x24f/0x310 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x13f/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f89a957fed9 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:00007f89a986fb98 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 0000000000020cf8 RCX: 00007f89a957fed9 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f89a9747ba0 R08: 0000000000000001 R09: 00007f89a986fe7f R10: 00007f89a9400000 R11: 0000000000000246 R12: 0000000000020da3 R13: 00007f89a9745fa0 R14: 0000000000000032 R15: ffffffffffffffff Allocated by task 5832: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4314 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] xpad_probe+0x3c8/0x1b90 drivers/input/joystick/xpad.c:1999 usb_probe_interface+0x641/0xbb0 drivers/usb/core/driver.c:396 really_probe+0x2b8/0xad0 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 driver_probe_device+0x50/0x430 drivers/base/dd.c:830 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:958 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:459 __device_attach+0x333/0x520 drivers/base/dd.c:1030 bus_probe_device+0x189/0x260 drivers/base/bus.c:534 device_add+0x856/0xbf0 drivers/base/core.c:3665 usb_set_configuration+0x1976/0x1fb0 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0x88/0x140 drivers/usb/core/generic.c:254 usb_probe_device+0x1b8/0x380 drivers/usb/core/driver.c:291 really_probe+0x2b8/0xad0 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 driver_probe_device+0x50/0x430 drivers/base/dd.c:830 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:958 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:459 __device_attach+0x333/0x520 drivers/base/dd.c:1030 bus_probe_device+0x189/0x260 drivers/base/bus.c:534 device_add+0x856/0xbf0 drivers/base/core.c:3665 usb_new_device+0x104a/0x19a0 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+0x2d6d/0x5150 drivers/usb/core/hub.c:5903 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/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 ffff888035519000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of freed 1024-byte region [ffff888035519000, ffff888035519400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88803551f800 pfn:0x35518 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801ac41dc0 ffffea00015e5410 ffffea0001426e10 raw: ffff88803551f800 000000000010000e 00000001f5000000 0000000000000000 head: 00fff00000000240 ffff88801ac41dc0 ffffea00015e5410 ffffea0001426e10 head: ffff88803551f800 000000000010000e 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea0000d54601 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 3496, tgid 3496 (kworker/u8:8), ts 74296230389, free_ts 74204224985 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3474 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 alloc_slab_page+0x6a/0x140 mm/slub.c:2408 allocate_slab+0x5a/0x2f0 mm/slub.c:2574 new_slab mm/slub.c:2627 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3815 __slab_alloc+0x58/0xa0 mm/slub.c:3905 __slab_alloc_node mm/slub.c:3980 [inline] slab_alloc_node mm/slub.c:4141 [inline] __do_kmalloc_node mm/slub.c:4282 [inline] __kmalloc_noprof+0x2e6/0x4c0 mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] ieee802_11_parse_elems_full+0xdb/0x2880 net/mac80211/parse.c:958 ieee802_11_parse_elems_crc net/mac80211/ieee80211_i.h:2386 [inline] ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2393 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1576 [inline] ieee80211_ibss_rx_queued_mgmt+0x4c8/0x2d70 net/mac80211/ibss.c:1607 ieee80211_iface_process_skb net/mac80211/iface.c:1616 [inline] ieee80211_iface_work+0x8a5/0xf20 net/mac80211/iface.c:1670 cfg80211_wiphy_work+0x2db/0x480 net/wireless/core.c:440 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 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:1127 [inline] free_unref_page+0xdef/0x1130 mm/page_alloc.c:2657 discard_slab mm/slub.c:2673 [inline] __put_partials+0xeb/0x130 mm/slub.c:3142 put_cpu_partial+0x17c/0x250 mm/slub.c:3217 __slab_free+0x2ea/0x3d0 mm/slub.c:4468 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4104 [inline] slab_alloc_node mm/slub.c:4153 [inline] kmem_cache_alloc_noprof+0x1d9/0x380 mm/slub.c:4160 getname_flags+0xb7/0x540 fs/namei.c:139 getname fs/namei.c:223 [inline] __do_sys_unlink fs/namei.c:4635 [inline] __se_sys_unlink fs/namei.c:4633 [inline] __x64_sys_unlink+0x3a/0x50 fs/namei.c:4633 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888035518f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888035519000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888035519080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888035519100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888035519180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 45 8b 65 00 mov 0x0(%r13),%r12d 4: 44 89 e6 mov %r12d,%esi 7: 83 e6 01 and $0x1,%esi a: 31 ff xor %edi,%edi c: e8 56 e9 0b 00 call 0xbe967 11: 41 83 e4 01 and $0x1,%r12d 15: 49 bc 00 00 00 00 00 movabs $0xdffffc0000000000,%r12 1c: fc ff df 1f: 75 07 jne 0x28 21: e8 01 e5 0b 00 call 0xbe527 26: eb 38 jmp 0x60 28: f3 90 pause * 2a: 42 0f b6 04 23 movzbl (%rbx,%r12,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 75 11 jne 0x44 33: 41 f7 45 00 01 00 00 testl $0x1,0x0(%r13) 3a: 00 3b: 74 1e je 0x5b 3d: e8 .byte 0xe8 3e: e5 e4 in $0xe4,%eax