xpad 2-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 2-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: use-after-free in register_lock_class+0x7ce/0x860 kernel/locking/lockdep.c:1331
Read of size 1 at addr ffff88807c70c891 by task syz.0.340/5473
CPU: 0 PID: 5473 Comm: syz.0.340 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
register_lock_class+0x7ce/0x860 kernel/locking/lockdep.c:1331
__lock_acquire+0x160/0x7c50 kernel/locking/lockdep.c:4928
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xf4/0x190 kernel/sched/wait.c:160
__usb_hcd_giveback_urb+0x396/0x520 drivers/usb/core/hcd.c:1678
dummy_timer+0x86f/0x3130 drivers/usb/gadget/udc/dummy_hcd.c:1994
__run_hrtimer kernel/time/hrtimer.c:1747 [inline]
__hrtimer_run_queues+0x554/0xd60 kernel/time/hrtimer.c:1811
hrtimer_run_softirq+0x183/0x2a0 kernel/time/hrtimer.c:1828
handle_softirqs+0x2a1/0x920 kernel/softirq.c:596
__do_softirq kernel/softirq.c:630 [inline]
invoke_softirq kernel/softirq.c:470 [inline]
__irq_exit_rcu+0x12f/0x220 kernel/softirq.c:679
irq_exit_rcu+0x5/0x20 kernel/softirq.c:691
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691
RIP: 0010:__sanitizer_cov_trace_const_cmp8+0x7a/0x80 kernel/kcov.c:322
Code: c1 e1 05 4c 8d 51 28 4d 39 ca 77 1e 49 ff c0 4c 89 02 48 c7 44 0a 08 07 00 00 00 48 89 7c 0a 10 48 89 74 0a 18 48 89 44 0a 20 0f 1f 44 00 00 48 8b 4e 08 48 83 c1 f8 48 c1 c1 3d 48 83 f9 07
RSP: 0018:ffffc9000c70f7b8 EFLAGS: 00000297
RAX: ffffffff81b57ecb RBX: ffffea00019e7e00 RCX: ffff8880569b9dc0
RDX: 0000000000000002 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc9000c70f940 R08: dffffc0000000000 R09: fffff9400033cfc1
R10: fffff9400033cfc1 R11: 1ffffd400033cfc0 R12: 0000000000000cc0
R13: dffffc0000000000 R14: 00fff00000080003 R15: 0000000000000000
constant_test_bit arch/x86/include/asm/bitops.h:207 [inline]
arch_test_bit arch/x86/include/asm/bitops.h:239 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline]
folio_test_locked include/linux/page-flags.h:473 [inline]
shmem_add_to_page_cache+0x64b/0x1c00 mm/shmem.c:699
shmem_get_folio_gfp+0x158b/0x3400 mm/shmem.c:1971
shmem_get_folio mm/shmem.c:2072 [inline]
shmem_write_begin+0xee/0x3f0 mm/shmem.c:2556
generic_perform_write+0x2db/0x560 mm/filemap.c:3846
__generic_file_write_iter+0x172/0x430 mm/filemap.c:3974
generic_file_write_iter+0xab/0x2e0 mm/filemap.c:4006
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x44c/0x960 fs/read_write.c:584
ksys_write+0x143/0x240 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fa20138e1ff
Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 f9 92 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 4c 93 02 00 48
RSP: 002b:00007fa20222edf0 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000001000000 RCX: 00007fa20138e1ff
RDX: 0000000001000000 RSI: 00007fa1f71f7000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000009793
R10: 0000000000000002 R11: 0000000000000293 R12: 0000000000000003
R13: 00007fa20222eef0 R14: 00007fa20222eeb0 R15: 00007fa1f71f7000
Allocated by task 127:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
xpad_probe+0x41d/0x1d30 drivers/input/joystick/xpad.c:1969
usb_probe_interface+0x5a0/0xaf0 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x2aa/0xc70 drivers/base/dd.c:639
__driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
__device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
__device_attach+0x29b/0x460 drivers/base/dd.c:1015
bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
device_add+0xa00/0xfb0 drivers/base/core.c:3697
usb_set_configuration+0x1991/0x1fd0 drivers/usb/core/message.c:2165
usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
usb_probe_device+0x139/0x270 drivers/usb/core/driver.c:293
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x2aa/0xc70 drivers/base/dd.c:639
__driver_probe_device+0x18c/0x330 drivers/base/dd.c:785
driver_probe_device+0x4f/0x420 drivers/base/dd.c:815
__device_attach_driver+0x2c6/0x510 drivers/base/dd.c:943
bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
__device_attach+0x29b/0x460 drivers/base/dd.c:1015
bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
device_add+0xa00/0xfb0 drivers/base/core.c:3697
usb_new_device+0xd4d/0x1620 drivers/usb/core/hub.c:2659
hub_port_connect drivers/usb/core/hub.c:5517 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5657 [inline]
port_event drivers/usb/core/hub.c:5817 [inline]
hub_event+0x2d5e/0x54e0 drivers/usb/core/hub.c:5899
process_one_work+0x898/0x1160 kernel/workqueue.c:2292
worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Freed by task 5119:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3700
xpad_disconnect+0x34c/0x470 drivers/input/joystick/xpad.c:2150
usb_unbind_interface+0x1ee/0x860 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:550 [inline]
__device_release_driver drivers/base/dd.c:1260 [inline]
device_release_driver_internal+0x522/0x850 drivers/base/dd.c:1286
bus_remove_device+0x2e2/0x400 drivers/base/bus.c:531
device_del+0x628/0xa70 drivers/base/core.c:3885
usb_disable_device+0x3e2/0x890 drivers/usb/core/message.c:1414
usb_disconnect+0x348/0x8a0 drivers/usb/core/hub.c:2314
hub_port_connect drivers/usb/core/hub.c:5361 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5657 [inline]
port_event drivers/usb/core/hub.c:5817 [inline]
hub_event+0x1e24/0x54e0 drivers/usb/core/hub.c:5899
process_one_work+0x898/0x1160 kernel/workqueue.c:2292
worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
The buggy address belongs to the object at ffff88807c70c800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
1024-byte region [ffff88807c70c800, ffff88807c70cc00)
The buggy address belongs to the physical page:
page:ffffea0001f1c200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c708
head:ffffea0001f1c200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888017441dc0
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 3639, tgid 3639 (udevd), ts 30971571293, free_ts 30967519631
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
__alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
alloc_slab_page+0x5d/0x160 mm/slub.c:1799
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1997
___slab_alloc+0xbc6/0x1230 mm/slub.c:3154
__slab_alloc mm/slub.c:3240 [inline]
slab_alloc_node mm/slub.c:3325 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc_node_track_caller+0x9e/0x230 mm/slab_common.c:956
kmalloc_reserve net/core/skbuff.c:446 [inline]
__alloc_skb+0x22a/0x7e0 net/core/skbuff.c:515
alloc_skb include/linux/skbuff.h:1271 [inline]
netlink_alloc_large_skb net/netlink/af_netlink.c:1182 [inline]
netlink_sendmsg+0x645/0xbc0 net/netlink/af_netlink.c:1847
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
____sys_sendmsg+0x59b/0x970 net/socket.c:2519
___sys_sendmsg+0x21c/0x290 net/socket.c:2573
__sys_sendmsg net/socket.c:2602 [inline]
__do_sys_sendmsg net/socket.c:2611 [inline]
__se_sys_sendmsg+0x19e/0x270 net/socket.c:2609
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1459 [inline]
free_pcp_prepare mm/page_alloc.c:1509 [inline]
free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
free_slab mm/slub.c:2036 [inline]
discard_slab mm/slub.c:2042 [inline]
__unfreeze_partials+0x1a5/0x200 mm/slub.c:2591
put_cpu_partial+0x17c/0x250 mm/slub.c:2667
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3359 [inline]
__kmem_cache_alloc_node+0x140/0x260 mm/slub.c:3398
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc+0xa0/0x240 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
tomoyo_add_entry security/tomoyo/common.c:2022 [inline]
tomoyo_supervisor+0xba7/0x10b0 security/tomoyo/common.c:2094
tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline]
tomoyo_env_perm+0x146/0x1e0 security/tomoyo/environ.c:63
tomoyo_environ security/tomoyo/domain.c:672 [inline]
tomoyo_find_next_domain+0x157a/0x1a40 security/tomoyo/domain.c:882
tomoyo_bprm_check_security+0x100/0x150 security/tomoyo/tomoyo.c:101
security_bprm_check+0x5e/0x90 security/security.c:869
search_binary_handler fs/exec.c:1752 [inline]
exec_binprm fs/exec.c:1805 [inline]
bprm_execve+0xa77/0x18a0 fs/exec.c:1874
Memory state around the buggy address:
ffff88807c70c780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807c70c800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807c70c880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807c70c900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807c70c980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: c1 e1 05 shl $0x5,%ecx
3: 4c 8d 51 28 lea 0x28(%rcx),%r10
7: 4d 39 ca cmp %r9,%r10
a: 77 1e ja 0x2a
c: 49 ff c0 inc %r8
f: 4c 89 02 mov %r8,(%rdx)
12: 48 c7 44 0a 08 07 00 movq $0x7,0x8(%rdx,%rcx,1)
19: 00 00
1b: 48 89 7c 0a 10 mov %rdi,0x10(%rdx,%rcx,1)
20: 48 89 74 0a 18 mov %rsi,0x18(%rdx,%rcx,1)
25: 48 89 44 0a 20 mov %rax,0x20(%rdx,%rcx,1)
* 2a: c3 ret <-- trapping instruction
2b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
30: 48 8b 4e 08 mov 0x8(%rsi),%rcx
34: 48 83 c1 f8 add $0xfffffffffffffff8,%rcx
38: 48 c1 c1 3d rol $0x3d,%rcx
3c: 48 83 f9 07 cmp $0x7,%rcx