xpad 5-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 5-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: slab-use-after-free in register_lock_class+0x101f/0x1230 kernel/locking/lockdep.c:1333
Read of size 1 at addr ffff888058fc7091 by task syz-executor.4/12524
CPU: 1 PID: 12524 Comm: syz-executor.4 Not tainted 6.9.0-rc6-syzkaller-00022-g98369dccd2f8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/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
register_lock_class+0x101f/0x1230 kernel/locking/lockdep.c:1333
__lock_acquire+0x111/0x3b30 kernel/locking/lockdep.c:5014
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719
__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+0x392/0x5c0 drivers/usb/core/hcd.c:1651
usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1732
dummy_timer+0x17fc/0x3940 drivers/usb/gadget/udc/dummy_hcd.c:1987
call_timer_fn+0x1a0/0x610 kernel/time/timer.c:1793
expire_timers kernel/time/timer.c:1844 [inline]
__run_timers+0x74b/0xaf0 kernel/time/timer.c:2418
__run_timer_base kernel/time/timer.c:2429 [inline]
__run_timer_base kernel/time/timer.c:2422 [inline]
run_timer_base+0x111/0x190 kernel/time/timer.c:2438
run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2448
__do_softirq+0x218/0x922 kernel/softirq.c:554
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu kernel/softirq.c:633 [inline]
irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:__might_resched+0x3f/0x5e0 kernel/sched/core.c:10152
Code: 89 f5 41 54 49 89 fc 55 89 d5 53 48 83 ec 50 48 c7 44 24 10 b3 8a b5 41 48 8d 5c 24 10 48 c7 44 24 18 d1 17 14 8d 48 c1 eb 03 <48> c7 44 24 20 30 99 5d 81 48 01 d8 c7 00 f1 f1 f1 f1 c7 40 04 00
RSP: 0018:ffffc900035977a8 EFLAGS: 00000a02
RAX: dffffc0000000000 RBX: 1ffff920006b2ef7 RCX: ffffc900047a1000
RDX: 0000000000000000 RSI: 000000000000013b RDI: ffffffff8b1de980
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000400 R11: 0000000000000002 R12: ffffffff8b1de980
R13: 000000000000013b R14: 0000000000000400 R15: 0000000000000400
might_alloc include/linux/sched/mm.h:315 [inline]
bdev_getblk+0x8d/0xc0 fs/buffer.c:1425
__bread_gfp+0xa9/0x370 fs/buffer.c:1474
sb_bread include/linux/buffer_head.h:321 [inline]
get_branch+0x2cb/0x6c0 fs/sysv/itree.c:102
get_block+0x1a1/0x15a0 fs/sysv/itree.c:222
block_read_full_folio+0x38f/0xa70 fs/buffer.c:2384
filemap_read_folio+0xe5/0x2c0 mm/filemap.c:2331
do_read_cache_folio+0x203/0x540 mm/filemap.c:3747
do_read_cache_page mm/filemap.c:3813 [inline]
read_cache_page+0x5b/0x160 mm/filemap.c:3822
read_mapping_page include/linux/pagemap.h:888 [inline]
dir_get_page fs/sysv/dir.c:64 [inline]
sysv_readdir+0x194/0x810 fs/sysv/dir.c:92
iterate_dir+0x292/0x9e0 fs/readdir.c:110
__do_sys_getdents64 fs/readdir.c:409 [inline]
__se_sys_getdents64 fs/readdir.c:394 [inline]
__x64_sys_getdents64+0x14f/0x2e0 fs/readdir.c:394
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f17fd27dea9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f17fe0ad0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f17fd3abf80 RCX: 00007f17fd27dea9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00007f17fd2ca4a4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f17fd3abf80 R15: 00007ffe011e0fa8
Allocated by task 12905:
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 include/linux/slab.h:628 [inline]
kzalloc include/linux/slab.h:749 [inline]
xpad_probe+0x27e/0x1f50 drivers/input/joystick/xpad.c:2021
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+0x1188/0x1ab0 drivers/base/core.c:3720
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+0x1188/0x1ab0 drivers/base/core.c:3720
usb_new_device+0xd90/0x1a10 drivers/usb/core/hub.c:2652
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+0x9a9/0x1ac0 kernel/workqueue.c:3267
process_scheduled_works kernel/workqueue.c:3348 [inline]
worker_thread+0x6c8/0xf70 kernel/workqueue.c:3429
kthread+0x2c1/0x3a0 kernel/kthread.c:388
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 17374:
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 mm/kasan/common.c:240 [inline]
__kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2106 [inline]
slab_free mm/slub.c:4280 [inline]
kfree+0x129/0x390 mm/slub.c:4390
xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2202
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/0xa10 drivers/base/core.c:3909
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: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+0x9a9/0x1ac0 kernel/workqueue.c:3267
process_scheduled_works kernel/workqueue.c:3348 [inline]
worker_thread+0x6c8/0xf70 kernel/workqueue.c:3429
kthread+0x2c1/0x3a0 kernel/kthread.c:388
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 ffff888058fc7000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
freed 1024-byte region [ffff888058fc7000, ffff888058fc7400)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x58fc0
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015041dc0 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015041dc0 0000000000000000 dead000000000001
head: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea000163f001 dead000000000122 00000000ffffffff
head: 0000000800000000 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 5194, tgid 2103868475 (udevd), ts 5194, free_ts 22497676320
create_dummy_stack mm/page_owner.c:94 [inline]
register_dummy_stack+0x8a/0xd0 mm/page_owner.c:100
init_page_owner+0x48/0xbf0 mm/page_owner.c:118
invoke_init_callbacks mm/page_ext.c:135 [inline]
page_ext_init+0x6af/0xaa0 mm/page_ext.c:480
mm_core_init+0x688/0x740 mm/mm_init.c:2789
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:1141 [inline]
free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
free_contig_range+0xb6/0x1a0 mm/page_alloc.c:6572
destroy_args+0xa69/0xe40 mm/debug_vm_pgtable.c:1036
debug_vm_pgtable+0x16db/0x3220 mm/debug_vm_pgtable.c:1416
do_one_initcall+0x128/0x700 init/main.c:1245
do_initcall_level init/main.c:1307 [inline]
do_initcalls init/main.c:1323 [inline]
do_basic_setup init/main.c:1342 [inline]
kernel_init_freeable+0x69d/0xca0 init/main.c:1555
kernel_init+0x1c/0x2b0 init/main.c:1444
ret_from_fork+0x45/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:
ffff888058fc6f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888058fc7000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888058fc7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888058fc7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888058fc7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 89 f5 mov %esi,%ebp
2: 41 54 push %r12
4: 49 89 fc mov %rdi,%r12
7: 55 push %rbp
8: 89 d5 mov %edx,%ebp
a: 53 push %rbx
b: 48 83 ec 50 sub $0x50,%rsp
f: 48 c7 44 24 10 b3 8a movq $0x41b58ab3,0x10(%rsp)
16: b5 41
18: 48 8d 5c 24 10 lea 0x10(%rsp),%rbx
1d: 48 c7 44 24 18 d1 17 movq $0xffffffff8d1417d1,0x18(%rsp)
24: 14 8d
26: 48 c1 eb 03 shr $0x3,%rbx
* 2a: 48 c7 44 24 20 30 99 movq $0xffffffff815d9930,0x20(%rsp) <-- trapping instruction
31: 5d 81
33: 48 01 d8 add %rbx,%rax
36: c7 00 f1 f1 f1 f1 movl $0xf1f1f1f1,(%rax)
3c: c7 .byte 0xc7
3d: 40 04 00 rex add $0x0,%al