xpad 9-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 9-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 ffff888053000891 by task ksoftirqd/0/15 CPU: 0 PID: 15 Comm: ksoftirqd/0 Not tainted 6.1.138-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/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/0x220 mm/kasan/report.c:427 kasan_report+0x10b/0x140 mm/kasan/report.c:531 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+0x888/0x31b0 drivers/usb/gadget/udc/dummy_hcd.c:1994 __run_hrtimer kernel/time/hrtimer.c:1691 [inline] __hrtimer_run_queues+0x522/0xc80 kernel/time/hrtimer.c:1755 hrtimer_run_softirq+0x176/0x240 kernel/time/hrtimer.c:1772 handle_softirqs+0x2a1/0x920 kernel/softirq.c:578 run_ksoftirqd+0x98/0xf0 kernel/softirq.c:945 smpboot_thread_fn+0x64a/0xa40 kernel/smpboot.c:164 kthread+0x29d/0x330 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 4755: 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:1967 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: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+0x2b02/0x5210 drivers/usb/core/hub.c:5867 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 5074: 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:1724 [inline] slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0xb6/0x1f0 mm/slub.c:3674 xpad_disconnect+0x34c/0x470 drivers/input/joystick/xpad.c:2148 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: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+0x1d20/0x5210 drivers/usb/core/hub.c:5867 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 ffff888053000800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of 1024-byte region [ffff888053000800, ffff888053000c00) The buggy address belongs to the physical page: page:ffffea00014c0000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x53000 head:ffffea00014c0000 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 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 15, tgid 15 (ksoftirqd/0), ts 505634742123, free_ts 499409186927 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:5606 alloc_slab_page+0x5d/0x160 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x87/0x2c0 mm/slub.c:1992 ___slab_alloc+0xbc6/0x1220 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437 __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 __pskb_copy_fclone+0xa6/0x1010 net/core/skbuff.c:1771 __pskb_copy include/linux/skbuff.h:1335 [inline] pskb_copy include/linux/skbuff.h:3544 [inline] nf_dup_ipv4+0x173/0x810 net/ipv4/netfilter/nf_dup_ipv4.c:63 nft_dup_ipv4_eval+0x1b9/0x2d0 net/ipv4/netfilter/nft_dup_ipv4.c:30 expr_call_ops_eval net/netfilter/nf_tables_core.c:214 [inline] nft_do_chain+0x408/0x1600 net/netfilter/nf_tables_core.c:264 nft_do_chain_ipv4+0x147/0x200 net/netfilter/nft_chain_filter.c:23 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xb9/0x200 net/netfilter/core.c:614 nf_hook include/linux/netfilter.h:257 [inline] NF_HOOK+0x200/0x390 include/linux/netfilter.h:300 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 __vunmap+0x856/0xa00 mm/vmalloc.c:2718 vb2_vmalloc_put+0x64/0xa0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:68 __vb2_buf_mem_free+0x113/0x2c0 drivers/media/common/videobuf2/videobuf2-core.c:266 __vb2_free_mem drivers/media/common/videobuf2/videobuf2-core.c:496 [inline] __vb2_queue_free+0x447/0xd80 drivers/media/common/videobuf2/videobuf2-core.c:541 vb2_core_queue_release+0x5b/0x80 drivers/media/common/videobuf2/videobuf2-core.c:2477 v4l2_m2m_ctx_release+0x1a/0x30 drivers/media/v4l2-core/v4l2-mem2mem.c:1273 vicodec_release+0x93/0x110 drivers/media/test-drivers/vicodec/vicodec-core.c:1933 v4l2_release+0x1f9/0x390 drivers/media/v4l2-core/v4l2-dev.c:456 __fput+0x22c/0x920 fs/file_table.c:320 task_work_run+0x1ca/0x250 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87 Memory state around the buggy address: ffff888053000780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888053000800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888053000880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888053000900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888053000980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================