xpad 3-1:0.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 3-1:0.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: use-after-free in register_lock_class+0x112c/0x11b0 kernel/locking/lockdep.c:1306
Read of size 1 at addr ffff8880216cb091 by task syz-executor.1/8274
CPU: 1 PID: 8274 Comm: syz-executor.1 Not tainted 5.18.0-rc2-syzkaller-00050-ga19944809fe9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description.constprop.0.cold+0xeb/0x467 mm/kasan/report.c:313
print_report mm/kasan/report.c:429 [inline]
kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491
register_lock_class+0x112c/0x11b0 kernel/locking/lockdep.c:1306
__lock_acquire+0x10a/0x56c0 kernel/locking/lockdep.c:4908
lock_acquire kernel/locking/lockdep.c:5641 [inline]
lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5606
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162
__wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:136
usb_anchor_resume_wakeups drivers/usb/core/urb.c:958 [inline]
usb_anchor_resume_wakeups+0xbe/0xe0 drivers/usb/core/urb.c:951
__usb_hcd_giveback_urb+0x2df/0x5c0 drivers/usb/core/hcd.c:1673
usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1747
dummy_timer+0x11f9/0x32b0 drivers/usb/gadget/udc/dummy_hcd.c:1988
call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1466 [inline]
__run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734
__run_timers kernel/time/timer.c:1715 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747
__do_softirq+0x29b/0x9c2 kernel/softirq.c:558
invoke_softirq kernel/softirq.c:432 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097
asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:rcu_is_watching+0x75/0xb0 kernel/rcu/tree.c:1139
Code: ff df 48 89 da 48 c1 ea 03 0f b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 19 8b 03 83 e0 01 65 ff 0d 6b 13 9f 7e <74> 03 5b 5d c3 e8 30 e8 9c ff 5b 5d c3 48 89 df e8 c6 f2 5f 00 eb
RSP: 0000:ffffc90015bcfb98 EFLAGS: 00000282
RAX: 0000000000000001 RBX: ffff8880b9d3b010 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffffffff8b79c8e8
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000019
R10: ffffffff819ecb32 R11: 000000000000003f R12: 00007f9e04899000
R13: ffffea0001aedf80 R14: ffff88801f459600 R15: 000000000000009f
rcu_read_lock_held_common kernel/rcu/update.c:108 [inline]
rcu_read_lock_held+0x18/0x40 kernel/rcu/update.c:309
xa_entry include/linux/xarray.h:1183 [inline]
xas_next_entry include/linux/xarray.h:1667 [inline]
next_map_page mm/filemap.c:3342 [inline]
filemap_map_pages+0xfb9/0x1e00 mm/filemap.c:3409
do_fault_around mm/memory.c:4219 [inline]
do_read_fault mm/memory.c:4234 [inline]
do_fault mm/memory.c:4369 [inline]
handle_pte_fault mm/memory.c:4627 [inline]
__handle_mm_fault+0x2742/0x4150 mm/memory.c:4763
handle_mm_fault+0x1c8/0x790 mm/memory.c:4861
do_user_addr_fault+0x489/0x11c0 arch/x86/mm/fault.c:1397
handle_page_fault arch/x86/mm/fault.c:1484 [inline]
exc_page_fault+0x9e/0x180 arch/x86/mm/fault.c:1540
asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0033:0x7f9e0489f0c0
Code: Unable to access opcode bytes at RIP 0x7f9e0489f096.
RSP: 002b:00007fff825f1ab8 EFLAGS: 00010216
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 000000000000000a RSI: 00007fff825f1fd8 RDI: 0000000000000001
RBP: 00007fff825f2010 R08: 00000000ffffffff R09: 0000000000000016
R10: 0000000000000000 R11: 0000000000000000 R12: 00007fff825f2030
R13: 00007f9e048e2faf R14: 00007fff825f21b0 R15: 0000000000000075
Allocated by task 22:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:436 [inline]
____kasan_kmalloc mm/kasan/common.c:515 [inline]
____kasan_kmalloc mm/kasan/common.c:474 [inline]
__kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524
kasan_kmalloc include/linux/kasan.h:234 [inline]
kmem_cache_alloc_trace+0x1ea/0x4a0 mm/slab.c:3583
kmalloc include/linux/slab.h:581 [inline]
kzalloc include/linux/slab.h:714 [inline]
xpad_probe+0x26c/0x1c20 drivers/input/joystick/xpad.c:1757
usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:541 [inline]
really_probe+0x23e/0xb20 drivers/base/dd.c:620
__driver_probe_device+0x338/0x4d0 drivers/base/dd.c:751
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:781
__device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:898
bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
__device_attach+0x228/0x4a0 drivers/base/dd.c:969
bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
device_add+0xb83/0x1e20 drivers/base/core.c:3405
usb_set_configuration+0x101e/0x1900 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238
usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:541 [inline]
really_probe+0x23e/0xb20 drivers/base/dd.c:620
__driver_probe_device+0x338/0x4d0 drivers/base/dd.c:751
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:781
__device_attach_driver+0x20b/0x2f0 drivers/base/dd.c:898
bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:427
__device_attach+0x228/0x4a0 drivers/base/dd.c:969
bus_probe_device+0x1e4/0x290 drivers/base/bus.c:487
device_add+0xb83/0x1e20 drivers/base/core.c:3405
usb_new_device.cold+0x641/0x1091 drivers/usb/core/hub.c:2566
hub_port_connect drivers/usb/core/hub.c:5363 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5507 [inline]
port_event drivers/usb/core/hub.c:5665 [inline]
hub_event+0x25c6/0x4680 drivers/usb/core/hub.c:5747
process_one_work+0x996/0x1610 kernel/workqueue.c:2289
worker_thread+0x665/0x1080 kernel/workqueue.c:2436
kthread+0x2e9/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
Freed by task 3676:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track+0x21/0x30 mm/kasan/common.c:45
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370
____kasan_slab_free mm/kasan/common.c:366 [inline]
____kasan_slab_free+0x13d/0x180 mm/kasan/common.c:328
kasan_slab_free include/linux/kasan.h:200 [inline]
__cache_free mm/slab.c:3439 [inline]
kfree+0x113/0x310 mm/slab.c:3810
xpad_disconnect+0x1cb/0x530 drivers/input/joystick/xpad.c:1905
usb_unbind_interface+0x1d8/0x8e0 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:531 [inline]
device_remove+0x11f/0x170 drivers/base/dd.c:523
__device_release_driver drivers/base/dd.c:1199 [inline]
device_release_driver_internal+0x4a3/0x680 drivers/base/dd.c:1222
bus_remove_device+0x2eb/0x5a0 drivers/base/bus.c:529
device_del+0x4f3/0xc80 drivers/base/core.c:3592
usb_disable_device+0x35b/0x7b0 drivers/usb/core/message.c:1419
usb_disconnect.cold+0x278/0x6ec drivers/usb/core/hub.c:2228
hub_port_connect drivers/usb/core/hub.c:5207 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5507 [inline]
port_event drivers/usb/core/hub.c:5665 [inline]
hub_event+0x1e74/0x4680 drivers/usb/core/hub.c:5747
process_one_work+0x996/0x1610 kernel/workqueue.c:2289
worker_thread+0x665/0x1080 kernel/workqueue.c:2436
kthread+0x2e9/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
The buggy address belongs to the object at ffff8880216cb000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
1024-byte region [ffff8880216cb000, ffff8880216cb400)
The buggy address belongs to the physical page:
page:ffffea000085b2c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880216cb800 pfn:0x216cb
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0001f5ac08 ffffea0001e19a08 ffff888010c40700
raw: ffff8880216cb800 ffff8880216cb000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x3c2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE), pid 5278, tgid 5277 (syz-executor.1), ts 206114928837, free_ts 176667652148
prep_new_page mm/page_alloc.c:2441 [inline]
get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182
__alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408
__alloc_pages_node include/linux/gfp.h:587 [inline]
kmem_getpages mm/slab.c:1378 [inline]
cache_grow_begin+0x75/0x350 mm/slab.c:2584
cache_alloc_refill+0x27f/0x380 mm/slab.c:2957
____cache_alloc mm/slab.c:3040 [inline]
____cache_alloc mm/slab.c:3023 [inline]
slab_alloc_node mm/slab.c:3241 [inline]
kmem_cache_alloc_node_trace+0x518/0x5b0 mm/slab.c:3625
__do_kmalloc_node mm/slab.c:3647 [inline]
__kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3662
kmalloc_reserve net/core/skbuff.c:354 [inline]
__alloc_skb+0xde/0x340 net/core/skbuff.c:426
alloc_skb include/linux/skbuff.h:1300 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
ctnetlink_conntrack_event+0x381/0x15b0 net/netfilter/nf_conntrack_netlink.c:744
__nf_conntrack_eventmask_report+0x198/0x4d0 net/netfilter/nf_conntrack_ecache.c:154
nf_conntrack_eventmask_report net/netfilter/nf_conntrack_ecache.c:195 [inline]
nf_conntrack_eventmask_report+0x1d0/0x370 net/netfilter/nf_conntrack_ecache.c:171
nf_conntrack_event_report include/net/netfilter/nf_conntrack_ecache.h:138 [inline]
nf_ct_delete.part.0+0x104/0x410 net/netfilter/nf_conntrack_core.c:707
nf_ct_delete+0x57/0x70 net/netfilter/nf_conntrack_core.c:695
nf_ct_kill include/net/netfilter/nf_conntrack.h:232 [inline]
nf_ct_gc_expired.part.0+0x189/0x1f0 net/netfilter/nf_conntrack_core.c:762
nf_ct_gc_expired net/netfilter/nf_conntrack_core.c:758 [inline]
____nf_conntrack_find net/netfilter/nf_conntrack_core.c:790 [inline]
__nf_conntrack_find_get+0x537/0x1400 net/netfilter/nf_conntrack_core.c:820
nf_conntrack_find_get+0xb6/0x1d0 net/netfilter/nf_conntrack_core.c:849
ctnetlink_new_conntrack+0x27a/0x10d0 net/netfilter/nf_conntrack_netlink.c:2448
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1356 [inline]
free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406
free_unref_page_prepare mm/page_alloc.c:3328 [inline]
free_unref_page_list+0x16f/0xf80 mm/page_alloc.c:3460
release_pages+0xff1/0x2290 mm/swap.c:980
tlb_batch_pages_flush mm/mmu_gather.c:50 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:243 [inline]
tlb_flush_mmu mm/mmu_gather.c:250 [inline]
tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:341
exit_mmap+0x1de/0x4a0 mm/mmap.c:3150
__mmput+0x122/0x4b0 kernel/fork.c:1183
mmput+0x56/0x60 kernel/fork.c:1205
exit_mm kernel/exit.c:510 [inline]
do_exit+0xa12/0x2a00 kernel/exit.c:782
do_group_exit+0xd2/0x2f0 kernel/exit.c:925
get_signal+0x22df/0x24c0 kernel/signal.c:2864
arch_do_signal_or_restart+0x82/0x20f0 arch/x86/kernel/signal.c:867
exit_to_user_mode_loop kernel/entry/common.c:166 [inline]
exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201
__syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae
Memory state around the buggy address:
ffff8880216caf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8880216cb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880216cb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880216cb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880216cb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 2 bytes skipped:
0: 48 89 da mov %rbx,%rdx
3: 48 c1 ea 03 shr $0x3,%rdx
7: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx
b: 48 89 d8 mov %rbx,%rax
e: 83 e0 07 and $0x7,%eax
11: 83 c0 03 add $0x3,%eax
14: 38 d0 cmp %dl,%al
16: 7c 04 jl 0x1c
18: 84 d2 test %dl,%dl
1a: 75 19 jne 0x35
1c: 8b 03 mov (%rbx),%eax
1e: 83 e0 01 and $0x1,%eax
21: 65 ff 0d 6b 13 9f 7e decl %gs:0x7e9f136b(%rip) # 0x7e9f1393
* 28: 74 03 je 0x2d <-- trapping instruction
2a: 5b pop %rbx
2b: 5d pop %rbp
2c: c3 retq
2d: e8 30 e8 9c ff callq 0xff9ce862
32: 5b pop %rbx
33: 5d pop %rbp
34: c3 retq
35: 48 89 df mov %rbx,%rdi
38: e8 c6 f2 5f 00 callq 0x5ff303
3d: eb .byte 0xeb