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: slab-use-after-free in register_lock_class+0x618/0x6ac kernel/locking/lockdep.c:1332 Read of size 1 at addr ffff0000d7d71091 by task syz.3.449/8802 CPU: 0 UID: 0 PID: 8802 Comm: syz.3.449 Not tainted 6.11.0-rc5-syzkaller-gdf54f4a16f82 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load1_noabort+0x20/0x2c mm/kasan/report_generic.c:378 register_lock_class+0x618/0x6ac kernel/locking/lockdep.c:1332 __lock_acquire+0x18c/0x779c kernel/locking/lockdep.c:5019 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x5c/0x7c kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:105 [inline] __wake_up+0x38/0x1b0 kernel/sched/wait.c:127 usb_anchor_resume_wakeups+0xc4/0x118 drivers/usb/core/urb.c:945 __usb_hcd_giveback_urb+0x374/0x570 drivers/usb/core/hcd.c:1653 usb_hcd_giveback_urb+0x108/0x3ac drivers/usb/core/hcd.c:1734 dummy_timer+0x630/0x341c drivers/usb/gadget/udc/dummy_hcd.c:1987 __run_hrtimer kernel/time/hrtimer.c:1689 [inline] __hrtimer_run_queues+0x494/0xce0 kernel/time/hrtimer.c:1753 hrtimer_interrupt+0x2c0/0xb64 kernel/time/hrtimer.c:1815 timer_handler drivers/clocksource/arm_arch_timer.c:674 [inline] arch_timer_handler_virt+0x74/0x88 drivers/clocksource/arm_arch_timer.c:685 handle_percpu_devid_irq+0x174/0x308 kernel/irq/chip.c:942 generic_handle_irq_desc include/linux/irqdesc.h:173 [inline] handle_irq_desc kernel/irq/irqdesc.c:692 [inline] generic_handle_domain_irq+0x7c/0xc4 kernel/irq/irqdesc.c:748 __gic_handle_irq drivers/irqchip/irq-gic-v3.c:843 [inline] __gic_handle_irq_from_irqson drivers/irqchip/irq-gic-v3.c:894 [inline] gic_handle_irq+0x6c/0x190 drivers/irqchip/irq-gic-v3.c:938 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:889 do_interrupt_handler+0xd4/0x138 arch/arm64/kernel/entry-common.c:310 __el1_irq arch/arm64/kernel/entry-common.c:536 [inline] el1_interrupt+0x34/0x68 arch/arm64/kernel/entry-common.c:551 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:556 el1h_64_irq+0x64/0x68 arch/arm64/kernel/entry.S:594 __lse__cmpxchg_case_rel_64 arch/arm64/include/asm/atomic_lse.h:276 [inline] __cmpxchg_case_rel_64 arch/arm64/include/asm/cmpxchg.h:125 [inline] __cmpxchg_rel arch/arm64/include/asm/cmpxchg.h:170 [inline] raw_atomic64_cmpxchg_release include/linux/atomic/atomic-arch-fallback.h:4209 [inline] raw_atomic64_try_cmpxchg_release include/linux/atomic/atomic-arch-fallback.h:4332 [inline] raw_atomic_long_try_cmpxchg_release include/linux/atomic/atomic-long.h:1506 [inline] atomic_long_try_cmpxchg_release include/linux/atomic/atomic-instrumented.h:4481 [inline] __mutex_unlock_slowpath+0x200/0x6b4 kernel/locking/mutex.c:929 mutex_unlock+0x18/0x24 kernel/locking/mutex.c:548 __unix_dgram_recvmsg+0x9b4/0xea4 net/unix/af_unix.c:2528 unix_dgram_recvmsg+0xd0/0xe8 net/unix/af_unix.c:2544 sock_recvmsg_nosec+0x90/0xec net/socket.c:1046 ____sys_recvmsg+0x58c/0x6e4 net/socket.c:2814 ___sys_recvmsg net/socket.c:2858 [inline] do_recvmmsg+0x3dc/0xb34 net/socket.c:2952 __sys_recvmmsg net/socket.c:3031 [inline] __do_sys_recvmmsg net/socket.c:3054 [inline] __se_sys_recvmmsg net/socket.c:3047 [inline] __arm64_sys_recvmmsg+0x180/0x23c net/socket.c:3047 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Allocated by task 6384: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __kmalloc_cache_noprof+0x244/0x374 mm/slub.c:4189 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] xpad_probe+0x34c/0x17a4 drivers/input/joystick/xpad.c:2026 usb_probe_interface+0x57c/0xa24 drivers/usb/core/driver.c:399 really_probe+0x38c/0x8fc drivers/base/dd.c:657 __driver_probe_device+0x194/0x374 drivers/base/dd.c:799 driver_probe_device+0x78/0x330 drivers/base/dd.c:829 __device_attach_driver+0x2a8/0x4f4 drivers/base/dd.c:957 bus_for_each_drv+0x228/0x2bc drivers/base/bus.c:457 __device_attach+0x2b4/0x434 drivers/base/dd.c:1029 device_initial_probe+0x24/0x34 drivers/base/dd.c:1078 bus_probe_device+0x178/0x240 drivers/base/bus.c:532 device_add+0x728/0xa6c drivers/base/core.c:3682 usb_set_configuration+0x15cc/0x1b38 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:254 usb_probe_device+0x1a4/0x348 drivers/usb/core/driver.c:294 really_probe+0x38c/0x8fc drivers/base/dd.c:657 __driver_probe_device+0x194/0x374 drivers/base/dd.c:799 driver_probe_device+0x78/0x330 drivers/base/dd.c:829 __device_attach_driver+0x2a8/0x4f4 drivers/base/dd.c:957 bus_for_each_drv+0x228/0x2bc drivers/base/bus.c:457 __device_attach+0x2b4/0x434 drivers/base/dd.c:1029 device_initial_probe+0x24/0x34 drivers/base/dd.c:1078 bus_probe_device+0x178/0x240 drivers/base/bus.c:532 device_add+0x728/0xa6c drivers/base/core.c:3682 usb_new_device+0x908/0x149c 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+0x2454/0x4280 drivers/usb/core/hub.c:5903 process_one_work+0x79c/0x15b8 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x978/0xec4 kernel/workqueue.c:3389 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Freed by task 7096: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:579 poison_slab_object+0x128/0x180 mm/kasan/common.c:240 __kasan_slab_free+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x154/0x3e0 mm/slub.c:4594 xpad_disconnect+0x2d4/0x3d8 drivers/input/joystick/xpad.c:2207 usb_unbind_interface+0x22c/0x7ec drivers/usb/core/driver.c:461 device_remove drivers/base/dd.c:568 [inline] __device_release_driver drivers/base/dd.c:1272 [inline] device_release_driver_internal+0x440/0x698 drivers/base/dd.c:1295 device_release_driver+0x28/0x38 drivers/base/dd.c:1318 bus_remove_device+0x314/0x3b4 drivers/base/bus.c:574 device_del+0x480/0x828 drivers/base/core.c:3871 usb_disable_device+0x354/0x760 drivers/usb/core/message.c:1418 usb_disconnect+0x290/0x808 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+0x1918/0x4280 drivers/usb/core/hub.c:5903 process_one_work+0x79c/0x15b8 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x978/0xec4 kernel/workqueue.c:3389 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 The buggy address belongs to the object at ffff0000d7d71000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of freed 1024-byte region [ffff0000d7d71000, ffff0000d7d71400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x117d70 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 05ffc00000000040 ffff0000c0001dc0 fffffdffc3463200 dead000000000002 raw: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000 head: 05ffc00000000040 ffff0000c0001dc0 fffffdffc3463200 dead000000000002 head: 0000000000000000 0000000000100010 00000001fdffffff 0000000000000000 head: 05ffc00000000003 fffffdffc35f5c01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d7d70f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d7d71000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000d7d71080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d7d71100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d7d71180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================