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+0x299/0x370 kernel/locking/spinlock_debug.c:115
Read of size 4 at addr ffff88806277c85c by task sed/10856
CPU: 0 UID: 0 PID: 10856 Comm: sed Not tainted 6.11.0-rc1-syzkaller-00044-g22f546873149 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0x169/0x550 mm/kasan/report.c:488
kasan_report+0x143/0x180 mm/kasan/report.c:601
debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
do_raw_spin_lock+0x299/0x370 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0xe1/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+0x830/0x45a0 drivers/usb/gadget/udc/dummy_hcd.c:1987
__run_hrtimer kernel/time/hrtimer.c:1689 [inline]
__hrtimer_run_queues+0x59b/0xd50 kernel/time/hrtimer.c:1753
hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1815
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
__sysvec_apic_timer_interrupt+0x110/0x3f0 arch/x86/kernel/apic/apic.c:1049
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:check_kcov_mode kernel/kcov.c:184 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x37/0x70 kernel/kcov.c:207
Code: 40 d7 03 00 65 8b 15 c0 70 70 7e f7 c2 00 01 ff 00 74 11 f7 c2 00 01 00 00 74 35 83 b9 1c 16 00 00 00 74 2c 8b 91 f8 15 00 00 <83> fa 02 75 21 48 8b 91 00 16 00 00 48 8b 32 48 8d 7e 01 8b 89 fc
RSP: 0018:ffffc9000489f818 EFLAGS: 00000246
RAX: ffffffff8bae9033 RBX: 0000000000000073 RCX: ffff88801afb1e00
RDX: 0000000000000000 RSI: ffffffff8ffeb3e0 RDI: 0000000000000073
RBP: ffffc9000489f910 R08: 0000000000000001 R09: ffffffff8bae8dfd
R10: 0000000000000005 R11: ffff88801afb1e00 R12: ffffffff8c18d901
R13: ffffc9000489f8a0 R14: dffffc0000000000 R15: 0000000000000073
format_decode+0xaf3/0x1bb0 lib/vsprintf.c:2618
vsnprintf+0x14f/0x1da0 lib/vsprintf.c:2776
seq_vprintf fs/seq_file.c:391 [inline]
seq_printf+0x172/0x270 fs/seq_file.c:406
filesystems_proc_show+0x99/0x100 fs/filesystems.c:244
seq_read_iter+0x445/0xd60 fs/seq_file.c:230
proc_reg_read_iter+0x1c3/0x290 fs/proc/inode.c:299
new_sync_read fs/read_write.c:395 [inline]
vfs_read+0x9bd/0xbc0 fs/read_write.c:476
ksys_read+0x1a0/0x2c0 fs/read_write.c:619
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
RIP: 0033:0x7f777b796b6a
Code: 00 3d 00 00 41 00 75 0d 50 48 8d 3d 2d 08 0a 00 e8 ea 7d 01 00 31 c0 e9 07 ff ff ff 64 8b 04 25 18 00 00 00 85 c0 75 1b 0f 05 <48> 3d 00 f0 ff ff 76 6c 48 8b 15 8f a2 0d 00 f7 d8 64 89 02 48 83
RSP: 002b:00007ffcd54b6128 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000558dd3abb2a0 RCX: 00007f777b796b6a
RDX: 0000000000000400 RSI: 0000558dd3abb500 RDI: 0000000000000003
RBP: 00007ffcd54b61c8 R08: 0000000000000003 R09: 00007f777b871b70
R10: 000000000000004f R11: 0000000000000246 R12: 00007ffcd54b61d0
R13: 00007ffcd54b61d0 R14: 000000000000000a R15: 0000000000000000
Allocated by task 8:
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:370 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__kmalloc_cache_noprof+0x19c/0x2c0 mm/slub.c:4189
kmalloc_noprof include/linux/slab.h:681 [inline]
kzalloc_noprof include/linux/slab.h:807 [inline]
xpad_probe+0x3c8/0x1b90 drivers/input/joystick/xpad.c:2026
usb_probe_interface+0x645/0xbb0 drivers/usb/core/driver.c:399
really_probe+0x2b8/0xad0 drivers/base/dd.c:657
__driver_probe_device+0x1a2/0x390 drivers/base/dd.c:799
driver_probe_device+0x50/0x430 drivers/base/dd.c:829
__device_attach_driver+0x2d6/0x530 drivers/base/dd.c:957
bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:457
__device_attach+0x333/0x520 drivers/base/dd.c:1029
bus_probe_device+0x189/0x260 drivers/base/bus.c:532
device_add+0x856/0xbf0 drivers/base/core.c:3679
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:294
really_probe+0x2b8/0xad0 drivers/base/dd.c:657
__driver_probe_device+0x1a2/0x390 drivers/base/dd.c:799
driver_probe_device+0x50/0x430 drivers/base/dd.c:829
__device_attach_driver+0x2d6/0x530 drivers/base/dd.c:957
bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:457
__device_attach+0x333/0x520 drivers/base/dd.c:1029
bus_probe_device+0x189/0x260 drivers/base/bus.c:532
device_add+0x856/0xbf0 drivers/base/core.c:3679
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+0x2d6a/0x5150 drivers/usb/core/hub.c:5903
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
worker_thread+0x86d/0xd40 kernel/workqueue.c:3390
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
Freed by task 47:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579
poison_slab_object+0xe0/0x150 mm/kasan/common.c:240
__kasan_slab_free+0x37/0x60 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2252 [inline]
slab_free mm/slub.c:4473 [inline]
kfree+0x149/0x360 mm/slub.c:4594
xpad_disconnect+0x359/0x490 drivers/input/joystick/xpad.c:2207
usb_unbind_interface+0x25e/0x940 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:568 [inline]
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x503/0x7c0 drivers/base/dd.c:1295
bus_remove_device+0x34f/0x420 drivers/base/bus.c:574
device_del+0x57a/0x9b0 drivers/base/core.c:3868
usb_disable_device+0x3bf/0x850 drivers/usb/core/message.c:1418
usb_disconnect+0x340/0x950 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+0x1eb9/0x5150 drivers/usb/core/hub.c:5903
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
worker_thread+0x86d/0xd40 kernel/workqueue.c:3390
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 ffff88806277c800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 92 bytes inside of
freed 1024-byte region [ffff88806277c800, ffff88806277cc00)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x62778
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: 0xfdffffff(slab)
raw: 00fff00000000040 ffff888015841dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff888015841dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000
head: 00fff00000000003 ffffea000189de01 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 5246, tgid 5246 (syz-executor), ts 86949552379, free_ts 27213619290
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493
prep_new_page mm/page_alloc.c:1501 [inline]
get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3442
__alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4700
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x5f/0x120 mm/slub.c:2321
allocate_slab+0x5a/0x2f0 mm/slub.c:2484
new_slab mm/slub.c:2537 [inline]
___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723
__slab_alloc+0x58/0xa0 mm/slub.c:3813
__slab_alloc_node mm/slub.c:3866 [inline]
slab_alloc_node mm/slub.c:4025 [inline]
__do_kmalloc_node mm/slub.c:4157 [inline]
__kmalloc_node_noprof+0x286/0x440 mm/slub.c:4164
kmalloc_node_noprof include/linux/slab.h:708 [inline]
qdisc_alloc+0x97/0xa80 net/sched/sch_generic.c:946
qdisc_create_dflt+0x62/0x4b0 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:2513 [inline]
attach_default_qdiscs net/sched/sch_generic.c:1192 [inline]
dev_activate+0x3c0/0x1240 net/sched/sch_generic.c:1251
__dev_open+0x352/0x450 net/core/dev.c:1483
__dev_change_flags+0x1e2/0x6f0 net/core/dev.c:8837
dev_change_flags+0x8b/0x1a0 net/core/dev.c:8909
do_setlink+0xccd/0x41f0 net/core/rtnetlink.c:2900
__rtnl_newlink net/core/rtnetlink.c:3696 [inline]
rtnl_newlink+0x180d/0x20a0 net/core/rtnetlink.c:3743
page last free pid 1 tgid 1 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1094 [inline]
free_unref_page+0xd22/0xea0 mm/page_alloc.c:2612
free_contig_range+0x9e/0x160 mm/page_alloc.c:6673
destroy_args+0x8a/0x890 mm/debug_vm_pgtable.c:1017
debug_vm_pgtable+0x4be/0x550 mm/debug_vm_pgtable.c:1397
do_one_initcall+0x248/0x880 init/main.c:1267
do_initcall_level+0x157/0x210 init/main.c:1329
do_initcalls+0x3f/0x80 init/main.c:1345
kernel_init_freeable+0x435/0x5d0 init/main.c:1578
kernel_init+0x1d/0x2b0 init/main.c:1467
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Memory state around the buggy address:
ffff88806277c700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88806277c780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88806277c800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88806277c880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88806277c900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 40 d7 rex xlat %ds:(%rbx)
2: 03 00 add (%rax),%eax
4: 65 8b 15 c0 70 70 7e mov %gs:0x7e7070c0(%rip),%edx # 0x7e7070cb
b: f7 c2 00 01 ff 00 test $0xff0100,%edx
11: 74 11 je 0x24
13: f7 c2 00 01 00 00 test $0x100,%edx
19: 74 35 je 0x50
1b: 83 b9 1c 16 00 00 00 cmpl $0x0,0x161c(%rcx)
22: 74 2c je 0x50
24: 8b 91 f8 15 00 00 mov 0x15f8(%rcx),%edx
* 2a: 83 fa 02 cmp $0x2,%edx <-- trapping instruction
2d: 75 21 jne 0x50
2f: 48 8b 91 00 16 00 00 mov 0x1600(%rcx),%rdx
36: 48 8b 32 mov (%rdx),%rsi
39: 48 8d 7e 01 lea 0x1(%rsi),%rdi
3d: 8b .byte 0x8b
3e: 89 fc mov %edi,%esp