xpad 1-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19
xpad 1-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19
==================================================================
BUG: KASAN: use-after-free in register_lock_class+0x8e8/0x990 kernel/locking/lockdep.c:1331
Read of size 1 at addr ffff88807c7ae891 by task kworker/u4:5/4300
CPU: 0 PID: 4300 Comm: kworker/u4:5 Not tainted 6.1.131-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Workqueue: bat_events batadv_nc_worker
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:427
kasan_report+0x136/0x160 mm/kasan/report.c:531
register_lock_class+0x8e8/0x990 kernel/locking/lockdep.c:1331
__lock_acquire+0xd3/0x1f80 kernel/locking/lockdep.c:4928
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xfd/0x1c0 kernel/sched/wait.c:160
__usb_hcd_giveback_urb+0x3a8/0x530 drivers/usb/core/hcd.c:1678
dummy_timer+0x8dc/0x32b0 drivers/usb/gadget/udc/dummy_hcd.c:1994
__run_hrtimer kernel/time/hrtimer.c:1689 [inline]
__hrtimer_run_queues+0x5e5/0xe50 kernel/time/hrtimer.c:1753
hrtimer_run_softirq+0x196/0x2c0 kernel/time/hrtimer.c:1770
handle_softirqs+0x2ee/0xa40 kernel/softirq.c:578
do_softirq+0x162/0x240 kernel/softirq.c:479
__local_bh_enable_ip+0x1b1/0x1f0 kernel/softirq.c:403
spin_unlock_bh include/linux/spinlock.h:396 [inline]
batadv_nc_purge_paths+0x30e/0x3b0 net/batman-adv/network-coding.c:471
batadv_nc_worker+0x361/0x610 net/batman-adv/network-coding.c:722
process_one_work+0x917/0x1260 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Allocated by task 4713:
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+0x97/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
xpad_probe+0x3be/0x1b80 drivers/input/joystick/xpad.c:1967
usb_probe_interface+0x5c0/0xaf0 drivers/usb/core/driver.c:396
really_probe+0x2ab/0xcb0 drivers/base/dd.c:639
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785
driver_probe_device+0x50/0x420 drivers/base/dd.c:815
__device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943
bus_for_each_drv+0x183/0x200 drivers/base/bus.c:429
__device_attach+0x359/0x570 drivers/base/dd.c:1015
bus_probe_device+0xba/0x1e0 drivers/base/bus.c:489
device_add+0xb48/0xfd0 drivers/base/core.c:3697
usb_set_configuration+0x19dd/0x2020 drivers/usb/core/message.c:2165
usb_generic_driver_probe+0x84/0x140 drivers/usb/core/generic.c:238
usb_probe_device+0x130/0x260 drivers/usb/core/driver.c:293
really_probe+0x2ab/0xcb0 drivers/base/dd.c:639
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785
driver_probe_device+0x50/0x420 drivers/base/dd.c:815
__device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943
bus_for_each_drv+0x183/0x200 drivers/base/bus.c:429
__device_attach+0x359/0x570 drivers/base/dd.c:1015
bus_probe_device+0xba/0x1e0 drivers/base/bus.c:489
device_add+0xb48/0xfd0 drivers/base/core.c:3697
usb_new_device+0xbdd/0x1900 drivers/usb/core/hub.c:2631
hub_port_connect drivers/usb/core/hub.c:5489 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5629 [inline]
port_event drivers/usb/core/hub.c:5785 [inline]
hub_event+0x2efe/0x5730 drivers/usb/core/hub.c:5867
process_one_work+0x917/0x1260 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Freed by task 4239:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
xpad_disconnect+0x355/0x480 drivers/input/joystick/xpad.c:2148
usb_unbind_interface+0x1cd/0x840 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+0x59e/0x880 drivers/base/dd.c:1286
bus_remove_device+0x2e5/0x400 drivers/base/bus.c:531
device_del+0x6e2/0xbd0 drivers/base/core.c:3885
usb_disable_device+0x3b8/0x840 drivers/usb/core/message.c:1414
usb_disconnect+0x33c/0x8c0 drivers/usb/core/hub.c:2286
hub_port_connect drivers/usb/core/hub.c:5333 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5629 [inline]
port_event drivers/usb/core/hub.c:5785 [inline]
hub_event+0x1f78/0x5730 drivers/usb/core/hub.c:5867
process_one_work+0x917/0x1260 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
The buggy address belongs to the object at ffff88807c7ae800
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 145 bytes inside of
1024-byte region [ffff88807c7ae800, ffff88807c7aec00)
The buggy address belongs to the physical page:
page:ffffea0001f1ea00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7c7a8
head:ffffea0001f1ea00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888017c41dc0
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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3621, tgid 3621 (S10udev), ts 22969024256, free_ts 19955513342
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x3731/0x38d0 mm/page_alloc.c:4328
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5606
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xc20/0x1270 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc+0xa1/0x230 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
kzalloc include/linux/slab.h:699 [inline]
tomoyo_init_log+0x1b44/0x2080 security/tomoyo/audit.c:275
tomoyo_supervisor+0x396/0x12d0 security/tomoyo/common.c:2088
tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline]
tomoyo_env_perm+0x174/0x210 security/tomoyo/environ.c:63
tomoyo_environ security/tomoyo/domain.c:672 [inline]
tomoyo_find_next_domain+0x1469/0x1d10 security/tomoyo/domain.c:882
tomoyo_bprm_check_security+0xfe/0x150 security/tomoyo/tomoyo.c:101
security_bprm_check+0x5f/0xa0 security/security.c:869
search_binary_handler fs/exec.c:1752 [inline]
exec_binprm fs/exec.c:1805 [inline]
bprm_execve+0x8bb/0x18a0 fs/exec.c:1874
do_execveat_common+0x580/0x720 fs/exec.c:1979
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+0x12a6/0x15b0 mm/page_alloc.c:3384
free_unref_page+0x33/0x3e0 mm/page_alloc.c:3479
free_contig_range+0x9a/0x150 mm/page_alloc.c:9566
destroy_args+0xfe/0x997 mm/debug_vm_pgtable.c:1031
debug_vm_pgtable+0x46d/0x4c2 mm/debug_vm_pgtable.c:1354
do_one_initcall+0x265/0x8f0 init/main.c:1298
do_initcall_level+0x157/0x207 init/main.c:1371
do_initcalls+0x49/0x86 init/main.c:1387
kernel_init_freeable+0x45c/0x60f init/main.c:1626
kernel_init+0x19/0x290 init/main.c:1514
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Memory state around the buggy address:
ffff88807c7ae780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807c7ae800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807c7ae880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807c7ae900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807c7ae980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================