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 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 ffff88813088985c by task modprobe/7510
CPU: 1 PID: 7510 Comm: modprobe Not tainted 6.10.0-rc6-syzkaller-00116-ge60284b63245 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
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+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:1987
__run_hrtimer kernel/time/hrtimer.c:1689 [inline]
__hrtimer_run_queues+0x20c/0xcc0 kernel/time/hrtimer.c:1753
hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1815
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+0x8b/0xb0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:get_current arch/x86/include/asm/current.h:49 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x4/0x60 kernel/kcov.c:206
Code: 00 e8 a0 ff ff ff 31 c0 c3 cc cc cc cc 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa <65> 48 8b 15 d4 7f b0 7e 65 8b 05 d5 7f b0 7e a9 00 01 ff 00 48 8b
RSP: 0018:ffffc90001e0eb00 EFLAGS: 00000293
RAX: 0000000000000000 RBX: ffffc90001e0f538 RCX: ffffc90001e0ebcc
RDX: ffff88812da13a00 RSI: ffffffff81154459 RDI: ffffc90001e0f538
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000003 R12: ffffffff8a7ac778
R13: ffffc90001e0f540 R14: ffffffff8a7ac77c R15: 0000000000000001
__read_once_word_nocheck+0x9/0x20 include/asm-generic/rwonce.h:67
deref_stack_reg arch/x86/kernel/unwind_orc.c:406 [inline]
unwind_next_frame+0xdc3/0x23a0 arch/x86/kernel/unwind_orc.c:585
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+0x9b/0xb0 mm/kasan/generic.c:541
__call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:3072
mas_topiary_node lib/maple_tree.c:2524 [inline]
mas_topiary_replace+0x171e/0x3600 lib/maple_tree.c:2630
mas_wmb_replace lib/maple_tree.c:2646 [inline]
mas_split.isra.0+0xab8/0x11b0 lib/maple_tree.c:3393
mas_commit_b_node.isra.0+0x894/0x14e0 lib/maple_tree.c:3446
mas_wr_bnode+0x187/0x220 lib/maple_tree.c:4158
mas_wr_modify lib/maple_tree.c:4196 [inline]
mas_wr_store_entry.isra.0+0x6c4/0x1610 lib/maple_tree.c:4229
mas_store_prealloc+0xb6/0x2a0 lib/maple_tree.c:5485
vma_complete+0x89e/0xdb0 mm/mmap.c:535
__split_vma+0xd3d/0x1190 mm/mmap.c:2440
split_vma mm/mmap.c:2466 [inline]
vma_modify+0x2af/0x360 mm/mmap.c:2507
vma_modify_flags include/linux/mm.h:3352 [inline]
mprotect_fixup+0x1e9/0xbe0 mm/mprotect.c:637
do_mprotect_pkey+0x9cf/0xd60 mm/mprotect.c:820
__do_sys_mprotect mm/mprotect.c:841 [inline]
__se_sys_mprotect mm/mprotect.c:838 [inline]
__x64_sys_mprotect+0x78/0xc0 mm/mprotect.c:838
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:0x7f2acec80bb7
Code: 00 00 00 b8 0b 00 00 00 0f 05 48 3d 01 f0 ff ff 73 01 c3 48 8d 0d b9 46 01 00 f7 d8 89 01 48 83 c8 ff c3 b8 0a 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8d 0d 99 46 01 00 f7 d8 89 01 48 83
RSP: 002b:00007ffea2b6abb8 EFLAGS: 00000206 ORIG_RAX: 000000000000000a
RAX: ffffffffffffffda RBX: 00007f2acec5dfc0 RCX: 00007f2acec80bb7
RDX: 0000000000000001 RSI: 0000000000001000 RDI: 00007f2ace9d5000
RBP: 00007ffea2b6acd0 R08: 00007ffea2b6ab48 R09: 00007f2acec5d5c0
R10: 00007f2ace9b4168 R11: 0000000000000206 R12: 00007f2acec5dfc0
R13: 00007f2acec88eda R14: 00007f2ace9d5f40 R15: 00007f2ace9d5740
Allocated by task 37:
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+0x8f/0xa0 mm/kasan/common.c:387
kmalloc_noprof include/linux/slab.h:660 [inline]
kzalloc_noprof include/linux/slab.h:778 [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: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:3679
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: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:3679
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+0x2e66/0x4f50 drivers/usb/core/hub.c:5903
process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3248
process_scheduled_works kernel/workqueue.c:3329 [inline]
worker_thread+0x6c8/0xf30 kernel/workqueue.c:3409
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 8:
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+0x14/0x30 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:4438 [inline]
kfree+0x10b/0x380 mm/slub.c:4559
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: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:3868
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+0x1be4/0x4f50 drivers/usb/core/hub.c:5903
process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3248
process_scheduled_works kernel/workqueue.c:3329 [inline]
worker_thread+0x6c8/0xf30 kernel/workqueue.c:3409
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 ffff888130889800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 92 bytes inside of
freed 1024-byte region [ffff888130889800, ffff888130889c00)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x130888
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0x200000000000040(head|node=0|zone=2)
page_type: 0xffffefff(slab)
raw: 0200000000000040 ffff888100041dc0 0000000000000000 0000000000000001
raw: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000
head: 0200000000000040 ffff888100041dc0 0000000000000000 0000000000000001
head: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000
head: 0200000000000003 ffffea0004c22201 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5473, tgid 5473 (kworker/u8:5), ts 129995359335, free_ts 129400844952
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473
prep_new_page mm/page_alloc.c:1481 [inline]
get_page_from_freelist+0x1316/0x2610 mm/page_alloc.c:3425
__alloc_pages_noprof+0x21e/0x2290 mm/page_alloc.c:4683
__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:3990 [inline]
__do_kmalloc_node mm/slub.c:4122 [inline]
__kmalloc_noprof+0x32b/0x3d0 mm/slub.c:4136
kmalloc_noprof include/linux/slab.h:664 [inline]
load_elf_phdrs+0x103/0x210 fs/binfmt_elf.c:526
load_elf_binary+0x1fe/0x4db0 fs/binfmt_elf.c:855
search_binary_handler fs/exec.c:1797 [inline]
exec_binprm fs/exec.c:1839 [inline]
bprm_execve fs/exec.c:1891 [inline]
bprm_execve+0x703/0x19a0 fs/exec.c:1867
kernel_execve+0x3cf/0x4e0 fs/exec.c:2058
call_usermodehelper_exec_async+0x255/0x4c0 kernel/umh.c:110
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
page last free pid 5448 tgid 5448 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1093 [inline]
free_unref_page+0x698/0xce0 mm/page_alloc.c:2588
__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+0x4e/0x70 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3940 [inline]
slab_alloc_node mm/slub.c:4002 [inline]
kmem_cache_alloc_noprof+0x11c/0x2b0 mm/slub.c:4009
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags+0x9b/0xf0 include/linux/audit.h:322
vfs_fstatat+0x9a/0x150 fs/stat.c:303
__do_sys_newfstatat+0xa6/0x130 fs/stat.c:468
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:
ffff888130889700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888130889780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888130889800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888130889880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888130889900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 00 e8 add %ch,%al
2: a0 ff ff ff 31 c0 c3 movabs 0xccccc3c031ffffff,%al
9: cc cc
b: cc int3
c: cc int3
d: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
14: 00 00
16: 90 nop
17: 90 nop
18: 90 nop
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: f3 0f 1e fa endbr64
* 2a: 65 48 8b 15 d4 7f b0 mov %gs:0x7eb07fd4(%rip),%rdx # 0x7eb08006 <-- trapping instruction
31: 7e
32: 65 8b 05 d5 7f b0 7e mov %gs:0x7eb07fd5(%rip),%eax # 0x7eb0800e
39: a9 00 01 ff 00 test $0xff0100,%eax
3e: 48 rex.W
3f: 8b .byte 0x8b