xpad 4-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 4-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19 ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x265/0x2b0 kernel/locking/spinlock_debug.c:114 Read of size 4 at addr ffff88802deed85c by task kworker/u4:3/26720 CPU: 1 PID: 26720 Comm: kworker/u4:3 Not tainted 6.3.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Workqueue: bat_events batadv_nc_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319 print_report mm/kasan/report.c:430 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:536 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x265/0x2b0 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x45/0x60 kernel/locking/spinlock.c:162 __wake_up_common_lock+0xb8/0x140 kernel/sched/wait.c:137 usb_anchor_resume_wakeups drivers/usb/core/urb.c:960 [inline] usb_anchor_resume_wakeups+0xc2/0xe0 drivers/usb/core/urb.c:953 __usb_hcd_giveback_urb+0x2e5/0x5c0 drivers/usb/core/hcd.c:1674 usb_hcd_giveback_urb+0x384/0x430 drivers/usb/core/hcd.c:1754 dummy_timer+0x13b6/0x3400 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x1a0/0x580 kernel/time/timer.c:1700 expire_timers+0x29b/0x4b0 kernel/time/timer.c:1751 __run_timers kernel/time/timer.c:2022 [inline] __run_timers kernel/time/timer.c:1995 [inline] run_timer_softirq+0x326/0x910 kernel/time/timer.c:2035 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:trace_lock_release include/trace/events/lock.h:69 [inline] RIP: 0010:lock_release+0xad/0x670 kernel/locking/lockdep.c:5680 Code: 07 0f 87 a8 04 00 00 89 db be 08 00 00 00 48 89 d8 48 c1 e8 06 48 8d 3c c5 90 54 77 8e e8 9b 49 6f 00 48 0f a3 1d c3 ab 12 0d <0f> 82 43 04 00 00 48 c7 c3 b0 89 77 8e 48 b8 00 00 00 00 00 fc ff RSP: 0018:ffffc9000393fbc0 EFLAGS: 00000247 RAX: 0000000000000001 RBX: 0000000000000001 RCX: ffffffff8164a8c5 RDX: fffffbfff1ceea93 RSI: 0000000000000008 RDI: ffffffff8e775490 RBP: 1ffff92000727f7a R08: 0000000000000000 R09: ffffffff8e775497 R10: fffffbfff1ceea92 R11: 0000000000000000 R12: ffffffff8c7955c0 R13: 0000000000000000 R14: dffffc0000000000 R15: 0000000000000311 rcu_lock_release include/linux/rcupdate.h:332 [inline] rcu_read_unlock include/linux/rcupdate.h:806 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline] batadv_nc_worker+0x86c/0xfe0 net/batman-adv/network-coding.c:719 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 6673: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] xpad_probe+0x275/0x1ed0 drivers/input/joystick/xpad.c:1957 usb_probe_interface+0x30f/0x960 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:552 [inline] really_probe+0x240/0xca0 drivers/base/dd.c:631 __driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:768 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:798 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:926 bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:998 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x11c4/0x1c50 drivers/base/core.c:3589 usb_set_configuration+0x10ee/0x1af0 drivers/usb/core/message.c:2171 usb_generic_driver_probe+0xcf/0x130 drivers/usb/core/generic.c:238 usb_probe_device+0xd8/0x2c0 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:552 [inline] really_probe+0x240/0xca0 drivers/base/dd.c:631 __driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:768 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:798 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:926 bus_for_each_drv+0x149/0x1d0 drivers/base/bus.c:457 __device_attach+0x1e4/0x4b0 drivers/base/dd.c:998 bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532 device_add+0x11c4/0x1c50 drivers/base/core.c:3589 usb_new_device+0xcb2/0x19d0 drivers/usb/core/hub.c:2575 hub_port_connect drivers/usb/core/hub.c:5407 [inline] hub_port_connect_change drivers/usb/core/hub.c:5551 [inline] port_event drivers/usb/core/hub.c:5711 [inline] hub_event+0x2d9e/0x4e40 drivers/usb/core/hub.c:5793 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 22887: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3800 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2138 usb_unbind_interface+0x1dc/0x8e0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:542 [inline] device_remove+0x11f/0x170 drivers/base/dd.c:534 __device_release_driver drivers/base/dd.c:1240 [inline] device_release_driver_internal+0x443/0x610 drivers/base/dd.c:1263 bus_remove_device+0x22c/0x420 drivers/base/bus.c:574 device_del+0x48a/0xb80 drivers/base/core.c:3775 usb_disable_device+0x35a/0x7b0 drivers/usb/core/message.c:1420 usb_disconnect+0x2db/0x8a0 drivers/usb/core/hub.c:2238 hub_port_connect drivers/usb/core/hub.c:5246 [inline] hub_port_connect_change drivers/usb/core/hub.c:5551 [inline] port_event drivers/usb/core/hub.c:5711 [inline] hub_event+0x1fbf/0x4e40 drivers/usb/core/hub.c:5793 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491 kvfree_call_rcu+0x70/0xad0 kernel/rcu/tree.c:3316 neigh_destroy+0x433/0x660 net/core/neighbour.c:941 neigh_release include/net/neighbour.h:449 [inline] neigh_cleanup_and_release+0x1f8/0x280 net/core/neighbour.c:103 neigh_periodic_work+0x60c/0xac0 net/core/neighbour.c:1025 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390 worker_thread+0x669/0x1090 kernel/workqueue.c:2537 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88802deed800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of freed 1024-byte region [ffff88802deed800, ffff88802deedc00) The buggy address belongs to the physical page: page:ffffea0000b7ba00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2dee8 head:ffffea0000b7ba00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012441dc0 ffffea0000735600 dead000000000002 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5128, tgid 5128 (syz-executor.5), ts 175123738692, free_ts 0 prep_new_page mm/page_alloc.c:2553 [inline] get_page_from_freelist+0x1190/0x2e20 mm/page_alloc.c:4326 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:5592 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2283 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3491 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1061 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] batadv_hardif_add_interface net/batman-adv/hard-interface.c:864 [inline] batadv_hard_if_event+0x92e/0x15e0 net/batman-adv/hard-interface.c:952 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1937 call_netdevice_notifiers_extack net/core/dev.c:1975 [inline] call_netdevice_notifiers net/core/dev.c:1989 [inline] register_netdevice+0xfb4/0x1640 net/core/dev.c:10079 geneve_configure+0x6f8/0xa70 drivers/net/geneve.c:1432 geneve_newlink+0x12c/0x2c0 drivers/net/geneve.c:1683 rtnl_newlink_create net/core/rtnetlink.c:3440 [inline] __rtnl_newlink+0x10c2/0x1840 net/core/rtnetlink.c:3657 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3670 page_owner free stack trace missing Memory state around the buggy address: ffff88802deed700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802deed780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802deed800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802deed880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802deed900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 0f 87 a8 04 00 00 ja 0x4ae 6: 89 db mov %ebx,%ebx 8: be 08 00 00 00 mov $0x8,%esi d: 48 89 d8 mov %rbx,%rax 10: 48 c1 e8 06 shr $0x6,%rax 14: 48 8d 3c c5 90 54 77 lea -0x7188ab70(,%rax,8),%rdi 1b: 8e 1c: e8 9b 49 6f 00 callq 0x6f49bc 21: 48 0f a3 1d c3 ab 12 bt %rbx,0xd12abc3(%rip) # 0xd12abec 28: 0d * 29: 0f 82 43 04 00 00 jb 0x472 <-- trapping instruction 2f: 48 c7 c3 b0 89 77 8e mov $0xffffffff8e7789b0,%rbx 36: 48 rex.W 37: b8 00 00 00 00 mov $0x0,%eax 3c: 00 fc add %bh,%ah 3e: ff .byte 0xff