xpad 6-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 6-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115
Read of size 4 at addr ffff8880803a305c by task syz-executor.1/5897
CPU: 1 PID: 5897 Comm: syz-executor.1 Not tainted 6.7.0-next-20240119-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
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
debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0x42/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:1653
usb_hcd_giveback_urb+0x389/0x430 drivers/usb/core/hcd.c:1733
dummy_timer+0x1415/0x3600 drivers/usb/gadget/udc/dummy_hcd.c:1987
call_timer_fn+0x1a0/0x5b0 kernel/time/timer.c:1700
expire_timers kernel/time/timer.c:1751 [inline]
__run_timers+0x762/0xaa0 kernel/time/timer.c:2038
run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2051
__do_softirq+0x218/0x8de kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0xb9/0x120 kernel/softirq.c:644
sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1076
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x60 kernel/kcov.c:200
Code: be b0 01 00 00 e8 a0 ff ff ff 31 c0 c3 cc cc cc cc 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1e fa 65 48 8b 15 f4 9f 77 7e 65 8b 05 f5 9f 77 7e a9 00 01
RSP: 0018:ffffc9001520efa0 EFLAGS: 00000287
RAX: 0000000000000002 RBX: ffffc9001520f028 RCX: ffffffff813c177e
RDX: ffff888026f33b80 RSI: ffffc9001520f388 RDI: 0000000000000006
RBP: ffffc9001520f3b0 R08: 0000000000000006 R09: ffffc9001520f388
R10: ffffc9001520f3b0 R11: 0000000000000002 R12: ffffc90015208000
R13: ffffc90015210000 R14: ffffc9001520f3b8 R15: ffffc9001520f388
unwind_next_frame+0x123c/0x2390 arch/x86/kernel/unwind_orc.c:672
arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
unpoison_slab_object mm/kasan/common.c:314 [inline]
__kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:340
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3813 [inline]
slab_alloc_node mm/slub.c:3860 [inline]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3867
kmem_cache_zalloc include/linux/slab.h:701 [inline]
__kernfs_new_node+0xd3/0x8a0 fs/kernfs/dir.c:615
kernfs_new_node+0x18c/0x240 fs/kernfs/dir.c:691
__kernfs_create_file+0x53/0x340 fs/kernfs/file.c:1025
sysfs_add_file_mode_ns+0x1ff/0x3b0 fs/sysfs/file.c:307
create_files fs/sysfs/group.c:64 [inline]
internal_create_group+0x31f/0xb50 fs/sysfs/group.c:152
internal_create_groups+0x9d/0x150 fs/sysfs/group.c:192
create_dir lib/kobject.c:77 [inline]
kobject_add_internal+0x4c2/0x970 lib/kobject.c:238
kobject_add_varg lib/kobject.c:372 [inline]
kobject_init_and_add+0x11c/0x190 lib/kobject.c:455
netdev_queue_add_kobject net/core/net-sysfs.c:1706 [inline]
netdev_queue_update_kobjects+0x20b/0x520 net/core/net-sysfs.c:1758
register_queue_kobjects net/core/net-sysfs.c:1819 [inline]
netdev_register_kobject+0x290/0x3f0 net/core/net-sysfs.c:2059
register_netdevice+0x1392/0x1db0 net/core/dev.c:10261
__ip_tunnel_create+0x4a5/0x670 net/ipv4/ip_tunnel.c:267
ip_tunnel_create net/ipv4/ip_tunnel.c:338 [inline]
ip_tunnel_ctl+0x517/0x9a0 net/ipv4/ip_tunnel.c:915
ipip_tunnel_ctl+0x11e/0x2a0 net/ipv4/ipip.c:344
ip_tunnel_siocdevprivate+0x11c/0x1d0 net/ipv4/ip_tunnel.c:990
dev_siocdevprivate net/core/dev_ioctl.c:490 [inline]
dev_ifsioc+0x535/0x10c0 net/core/dev_ioctl.c:598
dev_ioctl+0x1b2/0x10a0 net/core/dev_ioctl.c:812
sock_ioctl+0x5bf/0x6c0 net/socket.c:1268
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl fs/ioctl.c:857 [inline]
__x64_sys_ioctl+0x193/0x220 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7fdebbe7cda9
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:00007fdebccad0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fdebbfabf80 RCX: 00007fdebbe7cda9
RDX: 0000000020000d80 RSI: 00000000000089f1 RDI: 0000000000000003
RBP: 00007fdebbec947a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fdebbfabf80 R15: 00007fffc768ad88
Allocated by task 5165:
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:372 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:389
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
xpad_probe+0x27e/0x1f50 drivers/input/joystick/xpad.c:2005
usb_probe_interface+0x309/0x940 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x23a/0xcb0 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 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:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532
device_add+0x1188/0x1ab0 drivers/base/core.c:3625
usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2207
usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:254
usb_probe_device+0xec/0x360 drivers/usb/core/driver.c:294
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x23a/0xcb0 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 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:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532
device_add+0x1188/0x1ab0 drivers/base/core.c:3625
usb_new_device+0xd80/0x1a00 drivers/usb/core/hub.c:2596
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:5765 [inline]
hub_event+0x2db0/0x4e20 drivers/usb/core/hub.c:5847
process_one_work+0x8d5/0x16e0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2707 [inline]
worker_thread+0x8b6/0x1290 kernel/workqueue.c:2788
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:242
Freed by task 1141:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640
poison_slab_object mm/kasan/common.c:241 [inline]
__kasan_slab_free+0x121/0x1c0 mm/kasan/common.c:257
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x129/0x370 mm/slub.c:4409
xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2186
usb_unbind_interface+0x1e0/0x8d0 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:569 [inline]
device_remove+0x122/0x170 drivers/base/dd.c:561
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22f/0x420 drivers/base/bus.c:574
device_del+0x39b/0xa50 drivers/base/core.c:3814
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1416
usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2257
hub_port_connect drivers/usb/core/hub.c:5305 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5605 [inline]
port_event drivers/usb/core/hub.c:5765 [inline]
hub_event+0x1dbb/0x4e20 drivers/usb/core/hub.c:5847
process_one_work+0x8d5/0x16e0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2707 [inline]
worker_thread+0x8b6/0x1290 kernel/workqueue.c:2788
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:242
The buggy address belongs to the object at ffff8880803a3000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 92 bytes inside of
freed 1024-byte region [ffff8880803a3000, ffff8880803a3400)
The buggy address belongs to the physical page:
page:ffffea000200e800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x803a0
head:ffffea000200e800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff)
page_type: 0xffffffff()
raw: 00fff80000000840 ffff888014c41dc0 dead000000000100 dead000000000122
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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5102, tgid 5102 (syz-executor.1), ts 320449139490, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0xa19/0x3740 mm/page_alloc.c:3347
__alloc_pages+0x22e/0x2420 mm/page_alloc.c:4603
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4ab/0x1990 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node+0x372/0x480 mm/slub.c:3988
kmalloc_node include/linux/slab.h:610 [inline]
kzalloc_node include/linux/slab.h:722 [inline]
qdisc_alloc+0xb3/0xa90 net/sched/sch_generic.c:940
qdisc_create_dflt+0x73/0x400 net/sched/sch_generic.c:998
attach_one_default_qdisc net/sched/sch_generic.c:1163 [inline]
netdev_for_each_tx_queue include/linux/netdevice.h:2578 [inline]
attach_default_qdiscs net/sched/sch_generic.c:1181 [inline]
dev_activate+0x667/0x1310 net/sched/sch_generic.c:1240
__dev_open+0x396/0x4f0 net/core/dev.c:1455
dev_open net/core/dev.c:1482 [inline]
dev_open+0xf4/0x160 net/core/dev.c:1475
bond_enslave+0xa01/0x5da0 drivers/net/bonding/bond_main.c:2010
do_set_master+0x1bc/0x230 net/core/rtnetlink.c:2704
do_setlink+0xaed/0x40c0 net/core/rtnetlink.c:2910
__rtnl_newlink+0xc35/0x1960 net/core/rtnetlink.c:3701
page_owner free stack trace missing
Memory state around the buggy address:
ffff8880803a2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880803a2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880803a3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880803a3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880803a3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: be b0 01 00 00 mov $0x1b0,%esi
5: e8 a0 ff ff ff call 0xffffffaa
a: 31 c0 xor %eax,%eax
c: c3 ret
d: cc int3
e: cc int3
f: cc int3
10: cc int3
11: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
18: 00 00
1a: 90 nop
1b: 90 nop
1c: 90 nop
1d: 90 nop
1e: 90 nop
1f: 90 nop
20: 90 nop
21: 90 nop
22: 90 nop
23: 90 nop
24: 90 nop
25: 90 nop
26: 90 nop
27: 90 nop
28: 90 nop
29: 90 nop
* 2a: f3 0f 1e fa endbr64 <-- trapping instruction
2e: 65 48 8b 15 f4 9f 77 mov %gs:0x7e779ff4(%rip),%rdx # 0x7e77a02a
35: 7e
36: 65 8b 05 f5 9f 77 7e mov %gs:0x7e779ff5(%rip),%eax # 0x7e77a032
3d: a9 .byte 0xa9
3e: 00 01 add %al,(%rcx)