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 ffff88805bec505c by task syz-executor.0/5233 CPU: 2 PID: 5233 Comm: syz-executor.0 Not tainted 6.10.0-rc3-syzkaller-00021-g2ef5971ff345 #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:deref_stack_reg arch/x86/kernel/unwind_orc.c:403 [inline] RIP: 0010:unwind_next_frame+0xd9b/0x23a0 arch/x86/kernel/unwind_orc.c:585 Code: 51 00 e8 28 0a c4 ff e9 cd f6 ff ff e8 3e fc 51 00 49 8d 45 f8 ba 08 00 00 00 48 89 df 48 89 c6 48 89 44 24 28 e8 e5 ef ff ff <31> ff 41 89 c7 89 c6 e8 b9 f6 51 00 48 8d 4b 34 45 84 ff 0f 84 37 RSP: 0018:ffffc9000378f910 EFLAGS: 00000286 RAX: 0000000000000001 RBX: ffffc9000378f990 RCX: ffffffff813c8426 RDX: ffff88801be84880 RSI: ffffffff813c8489 RDI: 0000000000000005 RBP: 0000000000000001 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff907da7e8 R13: ffffc9000378fee8 R14: ffffffff907da7ec R15: 0000000000000002 arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:3072 destroy_inode+0x12c/0x1b0 fs/inode.c:316 iput_final fs/inode.c:1741 [inline] iput.part.0+0x5a8/0x7f0 fs/inode.c:1767 iput+0x5c/0x80 fs/inode.c:1757 dentry_unlink_inode+0x295/0x480 fs/dcache.c:400 __dentry_kill+0x1d0/0x600 fs/dcache.c:603 dput.part.0+0x4b1/0x9b0 fs/dcache.c:845 dput+0x1f/0x30 fs/dcache.c:835 __fput+0x54e/0xbb0 fs/file_table.c:430 __fput_sync+0x47/0x50 fs/file_table.c:507 __do_sys_close fs/open.c:1555 [inline] __se_sys_close fs/open.c:1540 [inline] __ia32_sys_close+0x86/0x100 fs/open.c:1540 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7314579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000ffd6d790 EFLAGS: 00000293 ORIG_RAX: 0000000000000006 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000058389400 RDX: 0000000000000000 RSI: 00000000f746aff4 RDI: 00000000ffd6de50 RBP: 00000000ffd6d82c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000286 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5099: 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 35: 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 ffff88805bec5000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of freed 1024-byte region [ffff88805bec5000, ffff88805bec5400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805bec0000 pfn:0x5bec0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000240(workingset|head|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 04fff00000000240 ffff888015442dc0 ffffea00016d7610 ffffea000174a210 raw: ffff88805bec0000 000000000010000c 00000001ffffefff 0000000000000000 head: 04fff00000000240 ffff888015442dc0 ffffea00016d7610 ffffea000174a210 head: ffff88805bec0000 000000000010000c 00000001ffffefff 0000000000000000 head: 04fff00000000003 ffffea00016fb001 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 11, tgid 11 (kworker/u32:0), ts 52607503067, free_ts 52545629596 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_noprof+0x37f/0x420 mm/slub.c:4135 kmalloc_noprof include/linux/slab.h:664 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] neigh_alloc net/core/neighbour.c:494 [inline] ___neigh_create+0x141e/0x2ae0 net/core/neighbour.c:648 ip6_finish_output2+0x111a/0x1880 net/ipv6/ip6_output.c:128 __ip6_finish_output net/ipv6/ip6_output.c:211 [inline] ip6_finish_output+0x3f9/0x1300 net/ipv6/ip6_output.c:222 NF_HOOK_COND include/linux/netfilter.h:303 [inline] ip6_output+0x1f8/0x540 net/ipv6/ip6_output.c:243 dst_output include/net/dst.h:450 [inline] NF_HOOK include/linux/netfilter.h:314 [inline] ndisc_send_skb+0xa2d/0x1c30 net/ipv6/ndisc.c:509 ndisc_send_ns+0xc7/0x150 net/ipv6/ndisc.c:667 addrconf_dad_work+0xca5/0x1500 net/ipv6/addrconf.c:4281 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 page last free pid 5298 tgid 5296 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 alloc_buffer_head+0x21/0x160 fs/buffer.c:3028 folio_alloc_buffers+0x2c1/0x780 fs/buffer.c:931 create_empty_buffers+0x36/0x480 fs/buffer.c:1673 ext4_block_write_begin+0xccd/0xef0 fs/ext4/inode.c:1038 ext4_da_write_begin+0x408/0x8f0 fs/ext4/inode.c:2891 generic_perform_write+0x272/0x620 mm/filemap.c:4015 ext4_buffered_write_iter+0x11f/0x3d0 fs/ext4/file.c:299 ext4_file_write_iter+0x874/0x1a40 fs/ext4/file.c:698 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 Memory state around the buggy address: ffff88805bec4f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805bec4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805bec5000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805bec5080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805bec5100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: e8 28 0a c4 ff call 0xffc40a2d 5: e9 cd f6 ff ff jmp 0xfffff6d7 a: e8 3e fc 51 00 call 0x51fc4d f: 49 8d 45 f8 lea -0x8(%r13),%rax 13: ba 08 00 00 00 mov $0x8,%edx 18: 48 89 df mov %rbx,%rdi 1b: 48 89 c6 mov %rax,%rsi 1e: 48 89 44 24 28 mov %rax,0x28(%rsp) 23: e8 e5 ef ff ff call 0xfffff00d * 28: 31 ff xor %edi,%edi <-- trapping instruction 2a: 41 89 c7 mov %eax,%r15d 2d: 89 c6 mov %eax,%esi 2f: e8 b9 f6 51 00 call 0x51f6ed 34: 48 8d 4b 34 lea 0x34(%rbx),%rcx 38: 45 84 ff test %r15b,%r15b 3b: 0f .byte 0xf 3c: 84 37 test %dh,(%rdi)