xpad 7-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 7-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 ffff888028973891 by task kswapd0/112
CPU: 1 PID: 112 Comm: kswapd0 Not tainted 6.10.0-rc2-syzkaller-00269-g96e09b8f8166 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
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+0x13f6/0x3530 drivers/usb/gadget/udc/dummy_hcd.c:1987
__run_hrtimer kernel/time/hrtimer.c:1687 [inline]
__hrtimer_run_queues+0x20c/0xcc0 kernel/time/hrtimer.c:1751
hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1813
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
__sysvec_apic_timer_interrupt+0x10f/0x450 arch/x86/kernel/apic/apic.c:1049
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:202
Code: 90 f3 0f 1e fa 53 48 8b 74 24 08 48 89 fb 48 83 c7 18 e8 ca 56 8c f6 48 89 df e8 92 d3 8c f6 e8 4d 87 b5 f6 fb bf 01 00 00 00 92 1b 7e f6 65 8b 05 f3 83 23 75 85 c0 74 06 5b c3 cc cc cc cc
RSP: 0018:ffffc90000e07618 EFLAGS: 00000206
RAX: 00000000002ad48b RBX: ffff8880154b4050 RCX: 1ffffffff28406c7
RDX: 0000000000000000 RSI: ffffffff8b2cba40 RDI: 0000000000000001
RBP: 0000000000000001 R08: 0000000000000001 R09: fffffbfff283f45a
R10: ffffffff941fa2d7 R11: 0000000000000002 R12: 0000000000000000
R13: dffffc0000000000 R14: ffff8880154b4000 R15: 0000000000000000
spin_unlock_irq include/linux/spinlock.h:401 [inline]
evict_folios+0x632/0x1bf0 mm/vmscan.c:4548
try_to_shrink_lruvec+0x618/0x9b0 mm/vmscan.c:4749
shrink_one+0x3f8/0x7c0 mm/vmscan.c:4788
shrink_many mm/vmscan.c:4851 [inline]
lru_gen_shrink_node+0x89f/0x1750 mm/vmscan.c:4951
shrink_node mm/vmscan.c:5910 [inline]
kswapd_shrink_node mm/vmscan.c:6720 [inline]
balance_pgdat+0x1105/0x1970 mm/vmscan.c:6911
kswapd+0x5ea/0xbf0 mm/vmscan.c:7180
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Allocated by task 5286:
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_noprof include/linux/slab.h:660 [inline]
kzalloc_noprof include/linux/slab.h:778 [inline]
xpad_probe+0x27e/0x1e60 drivers/input/joystick/xpad.c:2025
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+0x114b/0x1a70 drivers/base/core.c:3721
usb_set_configuration+0x10ea/0x1ca0 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+0x114b/0x1a70 drivers/base/core.c:3721
usb_new_device+0xd2c/0x1960 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+0x2db0/0x4e20 drivers/usb/core/hub.c:5903
process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393
kthread+0x2c1/0x3a0 kernel/kthread.c:389
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 5290:
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+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2195 [inline]
slab_free mm/slub.c:4436 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4557
xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2206
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/0x9f0 drivers/base/core.c:3910
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418
usb_disconnect+0x2e1/0x920 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+0x1dbb/0x4e20 drivers/usb/core/hub.c:5903
process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393
kthread+0x2c1/0x3a0 kernel/kthread.c:389
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 ffff888028973800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
freed 1024-byte region [ffff888028973800, ffff888028973c00)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28970
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: 0xffffefff(slab)
raw: 00fff00000000040 ffff888015442dc0 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000
head: 00fff00000000040 ffff888015442dc0 0000000000000000 dead000000000001
head: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000
head: 00fff00000000003 ffffea0000a25c01 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 5241, tgid 5241 (syz-executor.2), ts 126098734734, free_ts 126082052245
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468
prep_new_page mm/page_alloc.c:1476 [inline]
get_page_from_freelist+0x136a/0x2df0 mm/page_alloc.c:3402
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4660
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x56/0x110 mm/slub.c:2264
allocate_slab mm/slub.c:2427 [inline]
new_slab+0x84/0x260 mm/slub.c:2480
___slab_alloc+0xdac/0x1870 mm/slub.c:3666
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3756
__slab_alloc_node mm/slub.c:3809 [inline]
slab_alloc_node mm/slub.c:3988 [inline]
__do_kmalloc_node mm/slub.c:4120 [inline]
__kmalloc_node_noprof+0x36c/0x450 mm/slub.c:4128
kmalloc_node_noprof include/linux/slab.h:681 [inline]
qdisc_alloc+0xb3/0xbd0 net/sched/sch_generic.c:944
qdisc_create_dflt+0x73/0x440 net/sched/sch_generic.c:1006
attach_one_default_qdisc net/sched/sch_generic.c:1172 [inline]
netdev_for_each_tx_queue include/linux/netdevice.h:2504 [inline]
attach_default_qdiscs net/sched/sch_generic.c:1190 [inline]
dev_activate+0x667/0x1310 net/sched/sch_generic.c:1249
__dev_open+0x396/0x4e0 net/core/dev.c:1481
__dev_change_flags+0x561/0x720 net/core/dev.c:8781
dev_change_flags+0x8f/0x160 net/core/dev.c:8853
do_setlink+0x19a6/0x3ea0 net/core/rtnetlink.c:2900
__rtnl_newlink+0xc3a/0x1960 net/core/rtnetlink.c:3696
page last free pid 5241 tgid 5241 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1088 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2565
__put_partials+0x14c/0x170 mm/slub.c:2994
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3940 [inline]
slab_alloc_node mm/slub.c:4000 [inline]
kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4043
__alloc_skb+0x2b3/0x380 net/core/skbuff.c:656
alloc_skb include/linux/skbuff.h:1308 [inline]
netlink_alloc_large_skb+0x69/0x130 net/netlink/af_netlink.c:1210
netlink_sendmsg+0x689/0xd70 net/netlink/af_netlink.c:1880
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
__sys_sendto+0x47f/0x4e0 net/socket.c:2192
__do_compat_sys_socketcall+0x5e2/0x700 net/compat.c:475
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
Memory state around the buggy address:
ffff888028973780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888028973800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888028973880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888028973900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888028973980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 90 nop
1: f3 0f 1e fa endbr64
5: 53 push %rbx
6: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
b: 48 89 fb mov %rdi,%rbx
e: 48 83 c7 18 add $0x18,%rdi
12: e8 ca 56 8c f6 call 0xf68c56e1
17: 48 89 df mov %rbx,%rdi
1a: e8 92 d3 8c f6 call 0xf68cd3b1
1f: e8 4d 87 b5 f6 call 0xf6b58771
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 92 1b 7e f6 call 0xf67e1bc1 <-- trapping instruction
2f: 65 8b 05 f3 83 23 75 mov %gs:0x752383f3(%rip),%eax # 0x75238429
36: 85 c0 test %eax,%eax
38: 74 06 je 0x40
3a: 5b pop %rbx
3b: c3 ret
3c: cc int3
3d: cc int3
3e: cc int3
3f: cc int3