xpad 6-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 6-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+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff8880244d005c by task modprobe/5270 CPU: 3 PID: 5270 Comm: modprobe Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x271/0x2c0 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+0x392/0x5c0 drivers/usb/core/hcd.c:1651 usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1732 dummy_timer+0x13f6/0x3530 drivers/usb/gadget/udc/dummy_hcd.c:1987 __run_hrtimer kernel/time/hrtimer.c:1687 [inline] __hrtimer_run_queues+0x20c/0xcc0 kernel/time/hrtimer.c:1751 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1813 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline] __sysvec_apic_timer_interrupt+0x10f/0x450 arch/x86/kernel/apic/apic.c:1049 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:lock_acquire+0x1f2/0x560 kernel/locking/lockdep.c:5722 Code: c1 05 ca cd 95 7e 83 f8 01 0f 85 ea 02 00 00 9c 58 f6 c4 02 0f 85 d5 02 00 00 48 85 ed 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24 RSP: 0018:ffffc9000320f1c8 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: 1ffff92000641e3b RCX: ffffffff816bc8ae RDX: 0000000000000001 RSI: ffffffff8b2cbd40 RDI: ffffffff8b8fc6a0 RBP: 0000000000000200 R08: 0000000000000000 R09: fffffbfff283f463 R10: ffffffff941fa31f R11: 0000000000000001 R12: 0000000000000001 R13: 0000000000000000 R14: ffff88802c337fc0 R15: 0000000000000000 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] folio_add_lru+0x2b0/0x7f0 mm/swap.c:520 filemap_add_folio+0x1bd/0x220 mm/filemap.c:986 __filemap_get_folio+0x455/0xa80 mm/filemap.c:1958 grow_dev_folio fs/buffer.c:1049 [inline] grow_buffers fs/buffer.c:1115 [inline] __getblk_slow+0x184/0x610 fs/buffer.c:1141 bdev_getblk+0xb1/0xc0 fs/buffer.c:1443 ext4_sb_breadahead_unmovable+0x69/0xf0 fs/ext4/super.c:264 __ext4_get_inode_loc+0xff5/0x1420 fs/ext4/inode.c:4445 __ext4_get_inode_loc_noinmem+0xb9/0x160 fs/ext4/inode.c:4475 __ext4_iget+0x43a/0x4370 fs/ext4/inode.c:4697 ext4_lookup+0x37e/0x730 fs/ext4/namei.c:1854 lookup_open.isra.0+0x928/0x13c0 fs/namei.c:3483 open_last_lookups fs/namei.c:3574 [inline] path_openat+0x92f/0x29f0 fs/namei.c:3804 do_filp_open+0x1dc/0x430 fs/namei.c:3834 do_sys_openat2+0x17a/0x1e0 fs/open.c:1405 do_sys_open fs/open.c:1420 [inline] __do_sys_openat fs/open.c:1436 [inline] __se_sys_openat fs/open.c:1431 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1431 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:0x7f831b337a46 Code: 10 00 00 00 44 8b 54 24 e0 48 89 44 24 c0 48 8d 44 24 d0 48 89 44 24 c8 44 89 c2 4c 89 ce bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 0c f7 d8 89 05 0a 48 01 00 48 83 c8 ff c3 31 RSP: 002b:00007fffc8573938 EFLAGS: 00000287 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fffc8573b98 RCX: 00007f831b337a46 RDX: 0000000000080000 RSI: 00007fffc85739b0 RDI: 00000000ffffff9c RBP: 00007fffc85739a0 R08: 0000000000080000 R09: 00007fffc85739b0 R10: 0000000000000000 R11: 0000000000000287 R12: 00007fffc85739b0 R13: 0000000000000012 R14: 00007fffc8573b7f R15: 00000000ffffffff Allocated by task 4378: 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:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] xpad_probe+0x27e/0x1e60 drivers/input/joystick/xpad.c:2025 usb_probe_interface+0x309/0x9d0 drivers/usb/core/driver.c:399 call_driver_probe drivers/base/dd.c:578 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:656 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:798 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:828 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:956 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1028 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532 device_add+0x114b/0x1a70 drivers/base/core.c:3721 usb_set_configuration+0x10ea/0x1ca0 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:578 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:656 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:798 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:828 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:956 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1028 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532 device_add+0x114b/0x1a70 drivers/base/core.c:3721 usb_new_device+0xd2c/0x1960 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+0x2db0/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 57: 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+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2196 [inline] slab_free mm/slub.c:4437 [inline] kfree+0x12a/0x3b0 mm/slub.c:4558 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2206 usb_unbind_interface+0x1e8/0x970 drivers/usb/core/driver.c:461 device_remove drivers/base/dd.c:568 [inline] device_remove+0x122/0x170 drivers/base/dd.c:560 __device_release_driver drivers/base/dd.c:1270 [inline] device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1293 bus_remove_device+0x22f/0x420 drivers/base/bus.c:574 device_del+0x396/0x9f0 drivers/base/core.c:3910 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+0x1dbb/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 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 ffff8880244d0000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of freed 1024-byte region [ffff8880244d0000, ffff8880244d0400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x244d0 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: 0xffffefff(slab) raw: 00fff00000000040 ffff888015442dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff00000000040 ffff888015442dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff00000000003 ffffea0000913401 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 5114, tgid 5114 (sshd), ts 37914506462, free_ts 35074047657 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] __do_kmalloc_node mm/slub.c:4121 [inline] __kmalloc_node_noprof+0x36c/0x450 mm/slub.c:4129 kmalloc_node_noprof include/linux/slab.h:681 [inline] kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:634 kvmalloc_array_node_noprof include/linux/slab.h:800 [inline] bpf_int_jit_compile+0x7a7/0x1460 arch/x86/net/bpf_jit_comp.c:3277 bpf_prog_select_runtime+0x32a/0x4c0 kernel/bpf/core.c:2410 bpf_migrate_filter net/core/filter.c:1306 [inline] bpf_prepare_filter+0xd3c/0x1100 net/core/filter.c:1354 bpf_prog_create_from_user+0x1e4/0x2d0 net/core/filter.c:1448 seccomp_prepare_filter kernel/seccomp.c:680 [inline] seccomp_prepare_user_filter kernel/seccomp.c:717 [inline] seccomp_set_mode_filter kernel/seccomp.c:1935 [inline] do_seccomp+0x7b6/0x2580 kernel/seccomp.c:2055 prctl_set_seccomp+0x4b/0x70 kernel/seccomp.c:2108 __do_sys_prctl+0xc83/0x1e40 kernel/sys.c:2539 page last free pid 5101 tgid 5101 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2583 __put_partials+0x14c/0x170 mm/slub.c:2995 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4008 getname_flags.part.0+0x50/0x4f0 fs/namei.c:139 getname_flags include/linux/audit.h:322 [inline] getname+0x8f/0xe0 fs/namei.c:218 do_sys_openat2+0x104/0x1e0 fs/open.c:1399 do_sys_open fs/open.c:1420 [inline] __do_sys_openat fs/open.c:1436 [inline] __se_sys_openat fs/open.c:1431 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1431 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: ffff8880244cff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880244cff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880244d0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880244d0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880244d0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: c1 05 ca cd 95 7e 83 roll $0x83,0x7e95cdca(%rip) # 0x7e95cdd1 7: f8 clc 8: 01 0f add %ecx,(%rdi) a: 85 ea test %ebp,%edx c: 02 00 add (%rax),%al e: 00 9c 58 f6 c4 02 0f add %bl,0xf02c4f6(%rax,%rbx,2) 15: 85 d5 test %edx,%ebp 17: 02 00 add (%rax),%al 19: 00 48 85 add %cl,-0x7b(%rax) 1c: ed in (%dx),%eax 1d: 74 01 je 0x20 1f: fb sti 20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 27: fc ff df * 2a: 48 01 c3 add %rax,%rbx <-- trapping instruction 2d: 48 c7 03 00 00 00 00 movq $0x0,(%rbx) 34: 48 c7 43 08 00 00 00 movq $0x0,0x8(%rbx) 3b: 00 3c: 48 rex.W 3d: 8b .byte 0x8b 3e: 84 .byte 0x84 3f: 24 .byte 0x24