xpad 3-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: slab-use-after-free in register_lock_class+0x1033/0x1240 kernel/locking/lockdep.c:1343
Read of size 1 at addr ffff88805cdce091 by task syz.3.175/6589
CPU: 0 UID: 0 PID: 6589 Comm: syz.3.175 Not tainted 6.14.0-rc2-syzkaller-00039-g09fbf3d50205 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:489
kasan_report+0xd9/0x110 mm/kasan/report.c:602
register_lock_class+0x1033/0x1240 kernel/locking/lockdep.c:1343
__lock_acquire+0x135/0x3c40 kernel/locking/lockdep.c:5103
lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/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+0x17f7/0x3960 drivers/usb/gadget/udc/dummy_hcd.c:1994
__run_hrtimer kernel/time/hrtimer.c:1801 [inline]
__hrtimer_run_queues+0x20a/0xae0 kernel/time/hrtimer.c:1865
hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1882
handle_softirqs+0x213/0x8f0 kernel/softirq.c:561
__do_softirq kernel/softirq.c:595 [inline]
invoke_softirq kernel/softirq.c:435 [inline]
__irq_exit_rcu+0x109/0x170 kernel/softirq.c:662
irq_exit_rcu+0x9/0x30 kernel/softirq.c:678
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:check_kcov_mode kernel/kcov.c:185 [inline]
RIP: 0010:write_comp_data+0x3c/0x90 kernel/kcov.c:246
Code: 8b 05 10 0c 4a 7e a9 00 01 ff 00 74 1d f6 c4 01 74 67 a9 00 00 0f 00 75 60 a9 00 00 f0 00 75 59 8b 82 2c 16 00 00 85 c0 74 4f <8b> 82 08 16 00 00 83 f8 03 75 44 48 8b 82 10 16 00 00 8b 92 0c 16
RSP: 0018:ffffc900034e7218 EFLAGS: 00000246
RAX: 0000000080000000 RBX: 0000000000000001 RCX: ffffffff82267515
RDX: ffff888032bc4880 RSI: 0000000000000001 RDI: 0000000000000004
RBP: ffff88801de774f0 R08: 0000000000000004 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000007f35 R12: 00000000014602a3
R13: 0000000000000001 R14: 0000000000000000 R15: ffff88801de774a8
__update_page_owner_free_handle mm/page_owner.c:268 [inline]
__reset_page_owner+0x275/0x400 mm/page_owner.c:298
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1127 [inline]
free_unref_folios+0xa7b/0x1500 mm/page_alloc.c:2707
folios_put_refs+0x587/0x7b0 mm/swap.c:994
folio_batch_release include/linux/pagevec.h:101 [inline]
shmem_undo_range+0x586/0x1170 mm/shmem.c:1112
shmem_truncate_range mm/shmem.c:1224 [inline]
shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1352
evict+0x409/0x960 fs/inode.c:796
iput_final fs/inode.c:1946 [inline]
iput fs/inode.c:1972 [inline]
iput+0x52a/0x890 fs/inode.c:1958
dentry_unlink_inode+0x29c/0x480 fs/dcache.c:440
__dentry_kill+0x1d0/0x600 fs/dcache.c:643
dput.part.0+0x4b1/0x9b0 fs/dcache.c:885
dput+0x1f/0x30 fs/dcache.c:875
__fput+0x51c/0xb70 fs/file_table.c:472
task_work_run+0x14e/0x250 kernel/task_work.c:227
exit_task_work include/linux/task_work.h:40 [inline]
do_exit+0xad8/0x2d70 kernel/exit.c:938
do_group_exit+0xd3/0x2a0 kernel/exit.c:1087
get_signal+0x24ed/0x26c0 kernel/signal.c:3036
arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337
exit_to_user_mode_loop kernel/entry/common.c:111 [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+0x150/0x2a0 kernel/entry/common.c:218
do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7ead18cde9
Code: Unable to access opcode bytes at 0x7f7ead18cdbf.
RSP: 002b:00007f7eadfe10e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007f7ead3a6088 RCX: 00007f7ead18cde9
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f7ead3a6088
RBP: 00007f7ead3a6080 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7ead3a608c
R13: 0000000000000000 R14: 00007ffdd5c8f660 R15: 00007ffdd5c8f748
Allocated by task 5848:
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:377 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
kmalloc_noprof include/linux/slab.h:901 [inline]
kzalloc_noprof include/linux/slab.h:1037 [inline]
xpad_probe+0x27e/0x1f50 drivers/input/joystick/xpad.c:2006
usb_probe_interface+0x300/0x9c0 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x23e/0xa90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x440 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830
__device_attach_driver+0x1df/0x310 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:462
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
device_add+0x114b/0x1a70 drivers/base/core.c:3665
usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:250
usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:291
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x23e/0xa90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x440 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830
__device_attach_driver+0x1df/0x310 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:462
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
device_add+0x114b/0x1a70 drivers/base/core.c:3665
usb_new_device+0xd09/0x1a20 drivers/usb/core/hub.c:2652
hub_port_connect drivers/usb/core/hub.c:5523 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5663 [inline]
port_event drivers/usb/core/hub.c:5823 [inline]
hub_event+0x2d9a/0x4e10 drivers/usb/core/hub.c:5905
process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3317 [inline]
worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398
kthread+0x3af/0x750 kernel/kthread.c:464
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Freed by task 5894:
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:576
poison_slab_object mm/kasan/common.c:247 [inline]
__kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
kasan_slab_free include/linux/kasan.h:233 [inline]
slab_free_hook mm/slub.c:2353 [inline]
slab_free mm/slub.c:4609 [inline]
kfree+0x2c4/0x4d0 mm/slub.c:4757
xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2187
usb_unbind_interface+0x1e2/0x960 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:569 [inline]
device_remove+0x122/0x170 drivers/base/dd.c:561
__device_release_driver drivers/base/dd.c:1273 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1296
bus_remove_device+0x22f/0x420 drivers/base/bus.c:579
device_del+0x396/0x9f0 drivers/base/core.c:3854
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418
usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2305
hub_port_connect drivers/usb/core/hub.c:5363 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5663 [inline]
port_event drivers/usb/core/hub.c:5823 [inline]
hub_event+0x1da5/0x4e10 drivers/usb/core/hub.c:5905
process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3317 [inline]
worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398
kthread+0x3af/0x750 kernel/kthread.c:464
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
The buggy address belongs to the object at ffff88805cdce000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
freed 1024-byte region [ffff88805cdce000, ffff88805cdce400)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5cdc8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b041dc0 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b041dc0 0000000000000000 dead000000000001
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea0001737201 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 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5840, tgid 5840 (syz-executor), ts 344994307930, free_ts 12061001877
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551
prep_new_page mm/page_alloc.c:1559 [inline]
get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477
__alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4739
alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270
alloc_slab_page mm/slub.c:2423 [inline]
allocate_slab mm/slub.c:2587 [inline]
new_slab+0x23d/0x330 mm/slub.c:2640
___slab_alloc+0xc5d/0x1720 mm/slub.c:3826
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916
__slab_alloc_node mm/slub.c:3991 [inline]
slab_alloc_node mm/slub.c:4152 [inline]
__do_kmalloc_node mm/slub.c:4293 [inline]
__kmalloc_node_track_caller_noprof+0x2f1/0x510 mm/slub.c:4313
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:609
__alloc_skb+0x164/0x380 net/core/skbuff.c:678
alloc_skb include/linux/skbuff.h:1331 [inline]
nlmsg_new include/net/netlink.h:1018 [inline]
inet6_rt_notify+0xc7/0x260 net/ipv6/route.c:6213
fib6_add_rt2node net/ipv6/ip6_fib.c:1259 [inline]
fib6_add+0x251d/0x4b20 net/ipv6/ip6_fib.c:1488
__ip6_ins_rt net/ipv6/route.c:1317 [inline]
ip6_ins_rt+0xb6/0x110 net/ipv6/route.c:1327
__ipv6_ifa_notify+0xaf6/0xe10 net/ipv6/addrconf.c:6262
ipv6_ifa_notify net/ipv6/addrconf.c:6301 [inline]
add_addr+0x245/0x350 net/ipv6/addrconf.c:3201
add_v4_addrs+0x69e/0x9f0 net/ipv6/addrconf.c:3260
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:1127 [inline]
free_frozen_pages+0x6db/0xfb0 mm/page_alloc.c:2660
free_contig_range+0x133/0x3f0 mm/page_alloc.c:6678
destroy_args+0x66f/0x830 mm/debug_vm_pgtable.c:1017
debug_vm_pgtable+0x130f/0x2d60 mm/debug_vm_pgtable.c:1397
do_one_initcall+0x128/0x700 init/main.c:1257
do_initcall_level init/main.c:1319 [inline]
do_initcalls init/main.c:1335 [inline]
do_basic_setup init/main.c:1354 [inline]
kernel_init_freeable+0x5c7/0x900 init/main.c:1568
kernel_init+0x1c/0x2b0 init/main.c:1457
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Memory state around the buggy address:
ffff88805cdcdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88805cdce000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805cdce080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88805cdce100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88805cdce180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 8b 05 10 0c 4a 7e mov 0x7e4a0c10(%rip),%eax # 0x7e4a0c16
6: a9 00 01 ff 00 test $0xff0100,%eax
b: 74 1d je 0x2a
d: f6 c4 01 test $0x1,%ah
10: 74 67 je 0x79
12: a9 00 00 0f 00 test $0xf0000,%eax
17: 75 60 jne 0x79
19: a9 00 00 f0 00 test $0xf00000,%eax
1e: 75 59 jne 0x79
20: 8b 82 2c 16 00 00 mov 0x162c(%rdx),%eax
26: 85 c0 test %eax,%eax
28: 74 4f je 0x79
* 2a: 8b 82 08 16 00 00 mov 0x1608(%rdx),%eax <-- trapping instruction
30: 83 f8 03 cmp $0x3,%eax
33: 75 44 jne 0x79
35: 48 8b 82 10 16 00 00 mov 0x1610(%rdx),%rax
3c: 8b .byte 0x8b
3d: 92 xchg %eax,%edx
3e: 0c 16 or $0x16,%al