xpad 5-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 5-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: slab-use-after-free in register_lock_class+0x8d1/0x980 kernel/locking/lockdep.c:1333
Read of size 1 at addr ffff888029715891 by task syz.1.3960/21707
CPU: 0 PID: 21707 Comm: syz.1.3960 Not tainted 6.10.0-rc6-syzkaller-00212-g1dd28064d416 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0x169/0x550 mm/kasan/report.c:488
kasan_report+0x143/0x180 mm/kasan/report.c:601
register_lock_class+0x8d1/0x980 kernel/locking/lockdep.c:1333
__lock_acquire+0xda/0x1fd0 kernel/locking/lockdep.c:5014
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
__wake_up_common_lock+0x25/0x1e0 kernel/sched/wait.c:105
__usb_hcd_giveback_urb+0x4ff/0x6e0 drivers/usb/core/hcd.c:1653
dummy_timer+0x830/0x45d0 drivers/usb/gadget/udc/dummy_hcd.c:1987
__run_hrtimer kernel/time/hrtimer.c:1689 [inline]
__hrtimer_run_queues+0x59b/0xd50 kernel/time/hrtimer.c:1753
hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1815
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
__sysvec_apic_timer_interrupt+0x110/0x3f0 arch/x86/kernel/apic/apic.c:1049
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:pfn_valid include/linux/mmzone.h:2022 [inline]
RIP: 0010:__virt_addr_valid+0x23b/0x520 arch/x86/mm/physaddr.c:65
Code: 00 48 c7 c2 e0 69 c8 8b e8 b2 78 30 00 4d 85 ff 74 36 4c 89 f8 48 c1 e8 03 80 3c 28 00 74 08 4c 89 ff e8 38 43 b6 00 49 8b 1f <48> 89 de 48 83 e6 02 31 ff e8 57 dc 53 00 48 89 d8 48 83 e0 02 75
RSP: 0018:ffffc9000ab77598 EFLAGS: 00000246
RAX: 1ffff11027fff22c RBX: ffffea000000000f RCX: ffff888056c7da00
RDX: 0000000000000000 RSI: ffffffff8c1f15e0 RDI: ffffffff8c1f15a0
RBP: dffffc0000000000 R08: ffffffff81424eb4 R09: 1ffffffff25ee2b0
R10: dffffc0000000000 R11: fffffbfff25ee2b1 R12: 000000005c030000
R13: 00000000ffffff00 R14: ffffffff81424e83 R15: ffff88813fff9160
free_pages+0x15/0x50 mm/page_alloc.c:4782
free_pg_vec net/packet/af_packet.c:4329 [inline]
packet_set_ring+0x18f6/0x2450 net/packet/af_packet.c:4548
packet_release+0x7de/0xcc0 net/packet/af_packet.c:3155
__sock_release net/socket.c:659 [inline]
sock_close+0xbc/0x240 net/socket.c:1421
__fput+0x24a/0x8a0 fs/file_table.c:422
task_work_run+0x24f/0x310 kernel/task_work.c:180
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0xa27/0x27e0 kernel/exit.c:876
do_group_exit+0x207/0x2c0 kernel/exit.c:1025
get_signal+0x16a1/0x1740 kernel/signal.c:2909
arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310
exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
syscall_exit_to_user_mode+0xc9/0x360 kernel/entry/common.c:218
do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f082e575bd9
Code: Unable to access opcode bytes at 0x7f082e575baf.
RSP: 002b:00007f082f2660f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007f082e703f68 RCX: 00007f082e575bd9
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f082e703f6c
RBP: 00007f082e703f60 R08: 7fffffffffffffff R09: 00007f082f2666c0
R10: ffffffffffffffff R11: 0000000000000246 R12: 00007f082e703f6c
R13: 000000000000000b R14: 00007ffc83f04780 R15: 00007ffc83f04868
Allocated by task 17997:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
kmalloc_trace_noprof+0x19c/0x2c0 mm/slub.c:4154
kmalloc_noprof include/linux/slab.h:660 [inline]
kzalloc_noprof include/linux/slab.h:778 [inline]
xpad_probe+0x3c8/0x1b90 drivers/input/joystick/xpad.c:2026
usb_probe_interface+0x645/0xbb0 drivers/usb/core/driver.c:399
really_probe+0x2b8/0xad0 drivers/base/dd.c:656
__driver_probe_device+0x1a2/0x390 drivers/base/dd.c:798
driver_probe_device+0x50/0x430 drivers/base/dd.c:828
__device_attach_driver+0x2d6/0x530 drivers/base/dd.c:956
bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:457
__device_attach+0x333/0x520 drivers/base/dd.c:1028
bus_probe_device+0x189/0x260 drivers/base/bus.c:532
device_add+0x856/0xbf0 drivers/base/core.c:3679
usb_set_configuration+0x1976/0x1fb0 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0x88/0x140 drivers/usb/core/generic.c:254
usb_probe_device+0x1b8/0x380 drivers/usb/core/driver.c:294
really_probe+0x2b8/0xad0 drivers/base/dd.c:656
__driver_probe_device+0x1a2/0x390 drivers/base/dd.c:798
driver_probe_device+0x50/0x430 drivers/base/dd.c:828
__device_attach_driver+0x2d6/0x530 drivers/base/dd.c:956
bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:457
__device_attach+0x333/0x520 drivers/base/dd.c:1028
bus_probe_device+0x189/0x260 drivers/base/bus.c:532
device_add+0x856/0xbf0 drivers/base/core.c:3679
usb_new_device+0x104a/0x19a0 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+0x2d6a/0x5150 drivers/usb/core/hub.c:5903
process_one_work kernel/workqueue.c:3248 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Freed by task 5145:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579
poison_slab_object+0xe0/0x150 mm/kasan/common.c:240
__kasan_slab_free+0x37/0x60 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2196 [inline]
slab_free mm/slub.c:4438 [inline]
kfree+0x149/0x360 mm/slub.c:4559
xpad_disconnect+0x359/0x490 drivers/input/joystick/xpad.c:2207
usb_unbind_interface+0x25e/0x940 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:568 [inline]
__device_release_driver drivers/base/dd.c:1270 [inline]
device_release_driver_internal+0x503/0x7c0 drivers/base/dd.c:1293
bus_remove_device+0x34f/0x420 drivers/base/bus.c:574
device_del+0x57a/0x9b0 drivers/base/core.c:3868
usb_disable_device+0x3bf/0x850 drivers/usb/core/message.c:1418
usb_disconnect+0x340/0x950 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+0x1eb9/0x5150 drivers/usb/core/hub.c:5903
process_one_work kernel/workqueue.c:3248 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Last potentially related work creation:
kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47
__kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541
insert_work+0x3e/0x330 kernel/workqueue.c:2208
__queue_work+0xc16/0xee0 kernel/workqueue.c:2360
queue_work_on+0x1c2/0x380 kernel/workqueue.c:2411
queue_work include/linux/workqueue.h:621 [inline]
schedule_work include/linux/workqueue.h:682 [inline]
xpad360w_process_packet drivers/input/joystick/xpad.c:971 [inline]
xpad_irq_in+0xab0/0x2510 drivers/input/joystick/xpad.c:1182
__usb_hcd_giveback_urb+0x42c/0x6e0 drivers/usb/core/hcd.c:1650
dummy_timer+0x830/0x45d0 drivers/usb/gadget/udc/dummy_hcd.c:1987
__run_hrtimer kernel/time/hrtimer.c:1689 [inline]
__hrtimer_run_queues+0x59b/0xd50 kernel/time/hrtimer.c:1753
hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1815
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
__sysvec_apic_timer_interrupt+0x110/0x3f0 arch/x86/kernel/apic/apic.c:1049
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
Second to last potentially related work creation:
kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47
__kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541
insert_work+0x3e/0x330 kernel/workqueue.c:2208
__queue_work+0xc16/0xee0 kernel/workqueue.c:2360
queue_work_on+0x1c2/0x380 kernel/workqueue.c:2411
queue_work include/linux/workqueue.h:621 [inline]
schedule_work include/linux/workqueue.h:682 [inline]
xpad360w_process_packet drivers/input/joystick/xpad.c:971 [inline]
xpad_irq_in+0xab0/0x2510 drivers/input/joystick/xpad.c:1182
__usb_hcd_giveback_urb+0x42c/0x6e0 drivers/usb/core/hcd.c:1650
dummy_timer+0x830/0x45d0 drivers/usb/gadget/udc/dummy_hcd.c:1987
__run_hrtimer kernel/time/hrtimer.c:1689 [inline]
__hrtimer_run_queues+0x59b/0xd50 kernel/time/hrtimer.c:1753
hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1815
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
__sysvec_apic_timer_interrupt+0x110/0x3f0 arch/x86/kernel/apic/apic.c:1049
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
The buggy address belongs to the object at ffff888029715800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
freed 1024-byte region [ffff888029715800, ffff888029715c00)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29710
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: 0xffffefff(slab)
raw: 00fff00000000040 ffff888015041dc0 ffffea00015df400 dead000000000002
raw: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000
head: 00fff00000000040 ffff888015041dc0 ffffea00015df400 dead000000000002
head: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000
head: 00fff00000000003 ffffea0000a5c401 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4756, tgid 4756 (dhcpcd-run-hook), ts 49149095081, free_ts 49124394368
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1473
prep_new_page mm/page_alloc.c:1481 [inline]
get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3425
__alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4683
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x5f/0x120 mm/slub.c:2265
allocate_slab+0x5a/0x2f0 mm/slub.c:2428
new_slab mm/slub.c:2481 [inline]
___slab_alloc+0xcd1/0x14b0 mm/slub.c:3667
__slab_alloc+0x58/0xa0 mm/slub.c:3757
__slab_alloc_node mm/slub.c:3810 [inline]
slab_alloc_node mm/slub.c:3990 [inline]
__do_kmalloc_node mm/slub.c:4122 [inline]
__kmalloc_noprof+0x257/0x400 mm/slub.c:4136
kmalloc_noprof include/linux/slab.h:664 [inline]
kzalloc_noprof include/linux/slab.h:778 [inline]
tomoyo_init_log+0x1b3e/0x2050 security/tomoyo/audit.c:275
tomoyo_supervisor+0x38a/0x11f0 security/tomoyo/common.c:2089
tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline]
tomoyo_env_perm+0x178/0x210 security/tomoyo/environ.c:63
tomoyo_environ security/tomoyo/domain.c:672 [inline]
tomoyo_find_next_domain+0x1384/0x1cf0 security/tomoyo/domain.c:878
tomoyo_bprm_check_security+0x115/0x180 security/tomoyo/tomoyo.c:102
security_bprm_check+0x65/0x90 security/security.c:1191
search_binary_handler fs/exec.c:1785 [inline]
exec_binprm fs/exec.c:1839 [inline]
bprm_execve+0xa56/0x17c0 fs/exec.c:1891
do_execveat_common+0x553/0x700 fs/exec.c:1998
page last free pid 4755 tgid 4755 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1093 [inline]
free_unref_page+0xd19/0xea0 mm/page_alloc.c:2588
discard_slab mm/slub.c:2527 [inline]
__put_partials+0xeb/0x130 mm/slub.c:2995
put_cpu_partial+0x17c/0x250 mm/slub.c:3070
__slab_free+0x2ea/0x3d0 mm/slub.c:4308
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x23/0x80 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:4002 [inline]
kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4009
getname_flags+0xbd/0x4f0 fs/namei.c:139
vfs_fstatat+0x11c/0x190 fs/stat.c:303
__do_sys_newfstatat fs/stat.c:468 [inline]
__se_sys_newfstatat fs/stat.c:462 [inline]
__x64_sys_newfstatat+0x125/0x1b0 fs/stat.c:462
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff888029715780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888029715800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888029715880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888029715900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888029715980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 00 48 c7 add %cl,-0x39(%rax)
3: c2 e0 69 ret $0x69e0
6: c8 8b e8 b2 enter $0xe88b,$0xb2
a: 78 30 js 0x3c
c: 00 4d 85 add %cl,-0x7b(%rbp)
f: ff 74 36 4c push 0x4c(%rsi,%rsi,1)
13: 89 f8 mov %edi,%eax
15: 48 c1 e8 03 shr $0x3,%rax
19: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
1d: 74 08 je 0x27
1f: 4c 89 ff mov %r15,%rdi
22: e8 38 43 b6 00 call 0xb6435f
27: 49 8b 1f mov (%r15),%rbx
* 2a: 48 89 de mov %rbx,%rsi <-- trapping instruction
2d: 48 83 e6 02 and $0x2,%rsi
31: 31 ff xor %edi,%edi
33: e8 57 dc 53 00 call 0x53dc8f
38: 48 89 d8 mov %rbx,%rax
3b: 48 83 e0 02 and $0x2,%rax
3f: 75 .byte 0x75