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+0x23a/0x260 kernel/locking/spinlock_debug.c:115
Read of size 4 at addr ffff888058b3405c by task udevd/5190
CPU: 2 UID: 0 PID: 5190 Comm: udevd Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
do_raw_spin_lock+0x23a/0x260 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:156 [inline]
_raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:181
__wake_up_common_lock kernel/sched/wait.c:124 [inline]
__wake_up+0x1c/0x60 kernel/sched/wait.c:146
__usb_unanchor_urb drivers/usb/core/urb.c:155 [inline]
usb_anchor_resume_wakeups+0xc7/0xf0 drivers/usb/core/urb.c:149
__usb_hcd_giveback_urb+0x3d8/0x610 drivers/usb/core/hcd.c:1660
usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
dummy_timer+0xdb5/0x3840 drivers/usb/gadget/udc/dummy_hcd.c:2051
__run_hrtimer kernel/time/hrtimer.c:2079 [inline]
__hrtimer_run_queues+0x448/0x9a0 kernel/time/hrtimer.c:2136
hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2153
handle_softirqs+0x216/0xa20 kernel/softirq.c:669
__do_softirq kernel/softirq.c:703 [inline]
invoke_softirq kernel/softirq.c:542 [inline]
__irq_exit_rcu+0x178/0x220 kernel/softirq.c:786
irq_exit_rcu+0x9/0x30 kernel/softirq.c:809
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline]
sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1062
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674
RIP: 0010:write_comp_data+0xb/0xb0 kernel/kcov.c:246
Code: eb 71 7a 00 e9 6d fd ff ff 66 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 65 48 8b 05 50 4b ac 13 49 89 f0 <49> 89 d1 48 89 ce 65 48 8b 0d 2f 4b ac 13 48 63 d0 a9 00 01 00 ff
RSP: 0018:ffffc90029e0f9c0 EFLAGS: 00000246
RAX: 8000000000000000 RBX: ffff88803ba6aac0 RCX: ffffffff82cf5828
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000200 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: ffffffff82cf5800 R15: ffff88803ba6aac2
kernfs_iop_permission+0x28/0xc0 fs/kernfs/inode.c:280
do_inode_permission fs/namei.c:583 [inline]
inode_permission+0x3f4/0x630 fs/namei.c:653
lookup_inode_permission_may_exec fs/namei.c:702 [inline]
may_lookup fs/namei.c:1967 [inline]
link_path_walk+0xbe8/0x1bd0 fs/namei.c:2610
path_openat+0x1a7/0x23f0 fs/namei.c:5012
do_file_open+0x20e/0x430 fs/namei.c:5045
do_sys_openat2+0x163/0x1d0 fs/open.c:1443
do_sys_open fs/open.c:1449 [inline]
__do_sys_openat fs/open.c:1465 [inline]
__se_sys_openat fs/open.c:1460 [inline]
__x64_sys_openat+0x12d/0x210 fs/open.c:1460
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f243d4a7407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffccffb65d0 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f243db71880 RCX: 00007f243d4a7407
RDX: 0000000000080000 RSI: 00007ffccffb6750 RDI: ffffffffffffff9c
RBP: 0000000000000008 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000556a9735c7f5
R13: 0000556a9735c7f5 R14: 0000000000000001 R15: 0000000000000000
Allocated by task 50:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:409 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:426
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5680
_kmalloc_noprof include/linux/slab.h:991 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
xpad_probe+0x28e/0x1f60 drivers/input/joystick/xpad.c:2073
usb_probe_interface+0x386/0x980 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:629 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:707
__driver_probe_device+0x210/0x460 drivers/base/dd.c:869
driver_probe_device+0x4a/0x140 drivers/base/dd.c:899
__device_attach_driver+0x1df/0x320 drivers/base/dd.c:1027
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4c0 drivers/base/dd.c:1131
device_initial_probe+0xaf/0xf0 drivers/base/dd.c:1190
__bus_probe_device+0x60/0x160 drivers/base/bus.c:614
device_add+0x121d/0x1970 drivers/base/core.c:3778
usb_set_configuration+0xd97/0x1dc0 drivers/usb/core/message.c:2280
usb_generic_driver_probe+0xa1/0xe0 drivers/usb/core/generic.c:250
usb_probe_device+0xef/0x400 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:629 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:707
__driver_probe_device+0x210/0x460 drivers/base/dd.c:869
driver_probe_device+0x4a/0x140 drivers/base/dd.c:899
__device_attach_driver+0x1df/0x320 drivers/base/dd.c:1027
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500
__device_attach+0x1e4/0x4c0 drivers/base/dd.c:1131
device_initial_probe+0xaf/0xf0 drivers/base/dd.c:1190
__bus_probe_device+0x60/0x160 drivers/base/bus.c:614
device_add+0x121d/0x1970 drivers/base/core.c:3778
usb_new_device.part.0+0xcc2/0x1686 drivers/usb/core/hub.c:2713
usb_new_device include/linux/workqueue.h:715 [inline]
hub_port_connect drivers/usb/core/hub.c:5585 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5725 [inline]
port_event drivers/usb/core/hub.c:5889 [inline]
hub_event.cold+0x1e3/0xe90 drivers/usb/core/hub.c:5971
process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495
process_scheduled_works kernel/workqueue.c:3578 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659
kthread+0x373/0x450 kernel/kthread.c:436
ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Freed by task 30:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:264 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:296
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2780 [inline]
slab_free mm/slub.c:6630 [inline]
kfree+0x22b/0x6d0 mm/slub.c:6923
xpad_disconnect+0x1cf/0x530 drivers/input/joystick/xpad.c:2257
usb_unbind_interface+0x1dd/0x9b0 drivers/usb/core/driver.c:460
device_remove drivers/base/dd.c:619 [inline]
device_remove+0x12a/0x180 drivers/base/dd.c:611
__device_release_driver drivers/base/dd.c:1357 [inline]
device_release_driver_internal+0x441/0x610 drivers/base/dd.c:1380
bus_remove_device+0x2bc/0x560 drivers/base/bus.c:678
device_del+0x376/0x9b0 drivers/base/core.c:3967
usb_disable_device+0x367/0x810 drivers/usb/core/message.c:1484
usb_disconnect+0x2e2/0x9a0 drivers/usb/core/hub.c:2355
hub_port_connect drivers/usb/core/hub.c:5425 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5725 [inline]
port_event drivers/usb/core/hub.c:5889 [inline]
hub_event+0x1bb1/0x4420 drivers/usb/core/hub.c:5971
process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495
process_scheduled_works kernel/workqueue.c:3578 [inline]
worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659
kthread+0x373/0x450 kernel/kthread.c:436
ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
The buggy address belongs to the object at ffff888058b34000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 92 bytes inside of
freed 1024-byte region [ffff888058b34000, ffff888058b34400)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x58b30
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801d442dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801d442dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 14, tgid 14 (kworker/u32:1), ts 74346127737
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859
prep_new_page mm/page_alloc.c:1867 [inline]
get_page_from_freelist+0x112f/0x3640 mm/page_alloc.c:3940
__alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5464
alloc_slab_page mm/slub.c:3384 [inline]
allocate_slab mm/slub.c:3499 [inline]
new_slab+0xb1/0x6d0 mm/slub.c:3550
refill_objects+0xe3/0x410 mm/slub.c:7539
refill_sheaf mm/slub.c:2917 [inline]
__pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4811
alloc_from_pcs mm/slub.c:4887 [inline]
slab_alloc_node mm/slub.c:5021 [inline]
__do_kmalloc_node mm/slub.c:5530 [inline]
__kmalloc_noprof+0x677/0x840 mm/slub.c:5556
_kmalloc_noprof include/linux/slab.h:995 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
ieee802_11_parse_elems_full+0x17f/0x3500 net/mac80211/parse.c:1077
ieee80211_inform_bss+0x1a9/0x11d0 net/mac80211/scan.c:91
rdev_inform_bss net/wireless/rdev-ops.h:457 [inline]
cfg80211_inform_single_bss_data+0x898/0x1dc0 net/wireless/scan.c:2447
cfg80211_inform_bss_data+0x230/0x37c0 net/wireless/scan.c:3303
cfg80211_inform_bss_frame_data+0x449/0xa40 net/wireless/scan.c:3399
ieee80211_bss_info_update+0x310/0xa90 net/mac80211/scan.c:236
ieee80211_scan_rx+0x4e6/0xb60 net/mac80211/scan.c:370
__ieee80211_rx_handle_packet+0x130a/0x1b30 net/mac80211/rx.c:5414
ieee80211_rx_list+0xef4/0x2020 net/mac80211/rx.c:5765
page last free pid 7182 tgid 7177 ts 67163312333 stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
__free_pages_prepare mm/page_alloc.c:1403 [inline]
__free_frozen_pages+0x7b4/0x1110 mm/page_alloc.c:2957
__folio_put+0x3b4/0x5f0 mm/folio.c:106
folio_put include/linux/mm.h:2305 [inline]
put_page include/linux/mm.h:2374 [inline]
netmem_dec_ref include/net/netmem.h:444 [inline]
skb_netmem_unref include/linux/skbuff_ref.h:64 [inline]
skb_release_data+0x60c/0x860 net/core/skbuff.c:1117
skb_release_all net/core/skbuff.c:1188 [inline]
__napi_kfree_skb net/core/skbuff.c:1485 [inline]
kfree_skb_napi_cache net/core/skbuff.c:7455 [inline]
skb_attempt_defer_free+0x2fb/0x940 net/core/skbuff.c:7489
tcp_eat_recv_skb net/ipv4/tcp.c:1634 [inline]
tcp_recvmsg_locked+0x11fc/0x2b80 net/ipv4/tcp.c:2907
tcp_recvmsg+0x141/0x680 net/ipv4/tcp.c:2952
inet_recvmsg+0xd5/0x4c0 net/ipv4/af_inet.c:892
sock_recvmsg_nosec net/socket.c:1154 [inline]
sock_recvmsg+0x1b8/0x220 net/socket.c:1176
__sys_recvfrom+0x1f2/0x2f0 net/socket.c:2333
__do_sys_recvfrom net/socket.c:2348 [inline]
__se_sys_recvfrom net/socket.c:2344 [inline]
__x64_sys_recvfrom+0xe0/0x1c0 net/socket.c:2344
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff888058b33f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888058b33f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888058b34000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888058b34080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888058b34100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: eb 71 jmp 0x73
2: 7a 00 jp 0x4
4: e9 6d fd ff ff jmp 0xfffffd76
9: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
f: 90 nop
10: 90 nop
11: 90 nop
12: 90 nop
13: 90 nop
14: 90 nop
15: 90 nop
16: 90 nop
17: 90 nop
18: 90 nop
19: 90 nop
1a: 90 nop
1b: 90 nop
1c: 90 nop
1d: 90 nop
1e: 90 nop
1f: 65 48 8b 05 50 4b ac mov %gs:0x13ac4b50(%rip),%rax # 0x13ac4b77
26: 13
27: 49 89 f0 mov %rsi,%r8
* 2a: 49 89 d1 mov %rdx,%r9 <-- trapping instruction
2d: 48 89 ce mov %rcx,%rsi
30: 65 48 8b 0d 2f 4b ac mov %gs:0x13ac4b2f(%rip),%rcx # 0x13ac4b67
37: 13
38: 48 63 d0 movslq %eax,%rdx
3b: a9 00 01 00 ff test $0xff000100,%eax