xpad 2-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 2-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: use-after-free in register_lock_class+0x8e8/0x990 kernel/locking/lockdep.c:1331
Read of size 1 at addr ffff888027e6e891 by task udevd/3582
CPU: 1 PID: 3582 Comm: udevd Not tainted 6.1.86-syzkaller #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+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report+0x136/0x160 mm/kasan/report.c:495
register_lock_class+0x8e8/0x990 kernel/locking/lockdep.c:1331
__lock_acquire+0xd3/0x1f80 kernel/locking/lockdep.c:4928
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xfd/0x1c0 kernel/sched/wait.c:160
__usb_hcd_giveback_urb+0x3a8/0x530 drivers/usb/core/hcd.c:1678
dummy_timer+0x8ad/0x3200 drivers/usb/gadget/udc/dummy_hcd.c:1988
call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504
expire_timers kernel/time/timer.c:1549 [inline]
__run_timers+0x67c/0x890 kernel/time/timer.c:1820
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202
Code: c1 bc f5 ff 90 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 3e ce d5 f6 48 89 df e8 a6 0b d7 f6 e8 a1 94 fc f6 fb bf 01 00 00 00 56 98 c9 f6 65 8b 05 f7 b3 6d 75 85 c0 74 02 5b c3 e8 24 d9 6b
RSP: 0018:ffffc90004d8f7d8 EFLAGS: 00000286
RAX: db5826279fe5cd00 RBX: ffff888078e089c0 RCX: ffffffff816ad11a
RDX: dffffc0000000000 RSI: ffffffff8aec01c0 RDI: 0000000000000001
RBP: 1ffff1100f1c1137 R08: dffffc0000000000 R09: fffffbfff2093446
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea00014bb5c0
R13: 000000000000000d R14: ffffea00014bb5c0 R15: ffff888078e089b8
spin_unlock_irq include/linux/spinlock.h:401 [inline]
filemap_remove_folio+0x10d/0x2e0 mm/filemap.c:256
truncate_inode_folio+0x59/0x70 mm/truncate.c:195
shmem_undo_range+0x570/0x2390 mm/shmem.c:942
shmem_truncate_range mm/shmem.c:1062 [inline]
shmem_evict_inode+0x265/0xa60 mm/shmem.c:1171
evict+0x2a4/0x620 fs/inode.c:666
__dentry_kill+0x436/0x650 fs/dcache.c:607
dentry_kill+0xbb/0x290
dput+0xfb/0x1d0 fs/dcache.c:914
__fput+0x5e4/0x890 fs/file_table.c:328
task_work_run+0x246/0x300 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:177
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f56c1f170a8
Code: 48 8b 05 83 9d 0d 00 64 c7 00 16 00 00 00 83 c8 ff 48 83 c4 20 5b c3 64 8b 04 25 18 00 00 00 85 c0 75 20 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 5b 48 8b 15 51 9d 0d 00 f7 d8 64 89 02 48 83
RSP: 002b:00007ffce3b45688 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 00007f56c22c9ae0 RCX: 00007f56c1f170a8
RDX: 0000558f9b1b3fd8 RSI: 00007ffce3b44e88 RDI: 0000000000000008
RBP: 0000558ac3b4d2c0 R08: 0000000000000006 R09: 8c5593c8e2cbd10a
R10: 000000000000010f R11: 0000000000000246 R12: 0000000000000002
R13: 0000558ac3b5f2b0 R14: 0000000000000008 R15: 0000558ac3b4c910
Allocated by task 22:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:556 [inline]
kzalloc include/linux/slab.h:692 [inline]
xpad_probe+0x3be/0x1b10 drivers/input/joystick/xpad.c:1965
usb_probe_interface+0x5c0/0xaf0 drivers/usb/core/driver.c:396
really_probe+0x2ab/0xcb0 drivers/base/dd.c:639
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785
driver_probe_device+0x50/0x420 drivers/base/dd.c:815
__device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943
bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
__device_attach+0x359/0x570 drivers/base/dd.c:1015
bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487
device_add+0xb48/0xfd0 drivers/base/core.c:3686
usb_set_configuration+0x19dd/0x2020 drivers/usb/core/message.c:2165
usb_generic_driver_probe+0x84/0x140 drivers/usb/core/generic.c:238
usb_probe_device+0x130/0x260 drivers/usb/core/driver.c:293
really_probe+0x2ab/0xcb0 drivers/base/dd.c:639
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785
driver_probe_device+0x50/0x420 drivers/base/dd.c:815
__device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943
bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
__device_attach+0x359/0x570 drivers/base/dd.c:1015
bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487
device_add+0xb48/0xfd0 drivers/base/core.c:3686
usb_new_device+0xbdd/0x18f0 drivers/usb/core/hub.c:2614
hub_port_connect drivers/usb/core/hub.c:5465 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5605 [inline]
port_event drivers/usb/core/hub.c:5761 [inline]
hub_event+0x2efe/0x5730 drivers/usb/core/hub.c:5843
process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
Freed by task 14:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
xpad_disconnect+0x355/0x480 drivers/input/joystick/xpad.c:2146
usb_unbind_interface+0x1cd/0x840 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:550 [inline]
__device_release_driver drivers/base/dd.c:1260 [inline]
device_release_driver_internal+0x59e/0x880 drivers/base/dd.c:1286
bus_remove_device+0x2e5/0x400 drivers/base/bus.c:529
device_del+0x6e2/0xbd0 drivers/base/core.c:3874
usb_disable_device+0x3b8/0x840 drivers/usb/core/message.c:1414
usb_disconnect+0x33c/0x8c0 drivers/usb/core/hub.c:2269
hub_port_connect drivers/usb/core/hub.c:5309 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5605 [inline]
port_event drivers/usb/core/hub.c:5761 [inline]
hub_event+0x1f78/0x5730 drivers/usb/core/hub.c:5843
process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486
call_rcu+0x163/0xa10 kernel/rcu/tree.c:2844
process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
The buggy address belongs to the object at ffff888027e6e800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
1024-byte region [ffff888027e6e800, ffff888027e6ec00)
The buggy address belongs to the physical page:
page:ffffea00009f9a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27e68
head:ffffea00009f9a00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff80000010200(slab|head|node=0|zone=1|lastcpupid=0xfff)
raw: 00fff80000010200 dead000000000100 dead000000000122 ffff888012441dc0
raw: 0000000000000000 0000000000100010 00000001ffffffff 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 3568, tgid 3568 (syz-executor.4), ts 61876977811, free_ts 61676313470
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
prep_new_page mm/page_alloc.c:2520 [inline]
get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5547
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xc20/0x1270 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc_node_track_caller+0xa0/0x220 mm/slab_common.c:975
kmalloc_reserve net/core/skbuff.c:446 [inline]
__alloc_skb+0x135/0x670 net/core/skbuff.c:515
alloc_skb include/linux/skbuff.h:1271 [inline]
nlmsg_new include/net/netlink.h:991 [inline]
rtmsg_fib+0x140/0x620 net/ipv4/fib_semantics.c:522
fib_table_insert+0xfb6/0x1f20 net/ipv4/fib_trie.c:1404
fib_magic net/ipv4/fib_frontend.c:1104 [inline]
fib_add_ifaddr+0xf4c/0x1730 net/ipv4/fib_frontend.c:1148
fib_netdev_event+0x620/0x730 net/ipv4/fib_frontend.c:1486
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:455
__dev_notify_flags+0x304/0x610
dev_change_flags+0xe7/0x190 net/core/dev.c:8661
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1440 [inline]
free_pcp_prepare mm/page_alloc.c:1490 [inline]
free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358
free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
kmem_cache_alloc_node+0x136/0x310 mm/slub.c:3443
__alloc_skb+0xde/0x670 net/core/skbuff.c:505
alloc_skb include/linux/skbuff.h:1271 [inline]
alloc_skb_with_frags+0xa4/0x740 net/core/skbuff.c:6157
sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2746
unix_dgram_sendmsg+0x5b1/0x2050 net/unix/af_unix.c:1939
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
__sys_sendto+0x480/0x600 net/socket.c:2148
__do_sys_sendto net/socket.c:2160 [inline]
__se_sys_sendto net/socket.c:2156 [inline]
__x64_sys_sendto+0xda/0xf0 net/socket.c:2156
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
Memory state around the buggy address:
ffff888027e6e780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888027e6e800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888027e6e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888027e6e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888027e6e980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: c1 bc f5 ff 90 53 48 sarl $0x89,0x485390ff(%rbp,%rsi,8)
7: 89
8: fb sti
9: 48 83 c7 18 add $0x18,%rdi
d: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
12: e8 3e ce d5 f6 call 0xf6d5ce55
17: 48 89 df mov %rbx,%rdi
1a: e8 a6 0b d7 f6 call 0xf6d70bc5
1f: e8 a1 94 fc f6 call 0xf6fc94c5
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 56 98 c9 f6 call 0xf6c99885 <-- trapping instruction
2f: 65 8b 05 f7 b3 6d 75 mov %gs:0x756db3f7(%rip),%eax # 0x756db42d
36: 85 c0 test %eax,%eax
38: 74 02 je 0x3c
3a: 5b pop %rbx
3b: c3 ret
3c: e8 .byte 0xe8
3d: 24 d9 and $0xd9,%al
3f: 6b .byte 0x6b