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 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock+0x290/0x370 kernel/locking/spinlock_debug.c:114 Read of size 4 at addr ffff88807833a05c by task modprobe/6964 CPU: 1 PID: 6964 Comm: modprobe Not tainted 5.15.164-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] do_raw_spin_lock+0x290/0x370 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline] _raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:137 [inline] __wake_up+0xf5/0x1c0 kernel/sched/wait.c:157 __usb_hcd_giveback_urb+0x3a8/0x530 drivers/usb/core/hcd.c:1677 dummy_timer+0x8ad/0x3200 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x16d/0x560 kernel/time/timer.c:1451 expire_timers kernel/time/timer.c:1496 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1767 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1780 handle_softirqs+0x3a7/0x930 kernel/softirq.c:558 __do_softirq kernel/softirq.c:592 [inline] invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:641 irq_exit_rcu+0x5/0x20 kernel/softirq.c:653 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:slab_alloc_node mm/slub.c:3175 [inline] RIP: 0010:slab_alloc mm/slub.c:3228 [inline] RIP: 0010:kmem_cache_alloc+0x5a/0x280 mm/slub.c:3233 Code: 89 e6 ba 01 00 00 00 44 89 f9 e8 b1 19 00 00 48 85 c0 74 77 49 89 c5 41 b0 01 49 8b 45 00 65 48 03 05 2a c3 38 7e 48 8b 50 08 <48> 8b 28 48 85 ed 0f 84 f0 00 00 00 48 83 78 10 00 0f 84 e5 00 00 RSP: 0000:ffffc90003017b70 EFLAGS: 00000282 RAX: ffff8880b9b40fd0 RBX: ffff888018e5c620 RCX: ffffc90003017a03 RDX: 000000000002eee1 RSI: ffffffff8a8b3ca0 RDI: ffffffff8ad8f800 RBP: ffff8880749bbe70 R08: dffffc0000000001 R09: fffffbfff1bd2986 R10: 0000000000000000 R11: dffffc0000000001 R12: ffff888011df1000 R13: ffff888011df1000 R14: ffffffff81bcef29 R15: 0000000000000cc0 anon_vma_alloc mm/rmap.c:90 [inline] __anon_vma_prepare+0xb9/0x410 mm/rmap.c:199 anon_vma_prepare include/linux/rmap.h:152 [inline] do_cow_fault mm/memory.c:4250 [inline] do_fault mm/memory.c:4364 [inline] handle_pte_fault mm/memory.c:4621 [inline] __handle_mm_fault mm/memory.c:4756 [inline] handle_mm_fault+0x4e0f/0x5950 mm/memory.c:4854 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x7f7b36277105 Code: 47 d6 4d 89 d7 4d 39 d0 73 7f 44 89 d8 83 e0 02 89 85 f4 fe ff ff 74 3e 4c 89 f9 31 c0 4c 89 c7 4c 29 c1 83 bd f4 fe ff ff 00 aa 75 5b 48 8b 35 88 79 02 00 44 89 da 44 89 9d f4 fe ff ff 48 RSP: 002b:00007ffc6db96990 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 00007ffc6db96a38 RCX: 0000000000000958 RDX: 0000000000000003 RSI: 0000000000001000 RDI: 00007f7b3619d6a8 RBP: 00007ffc6db97120 R08: 00007f7b3619d6a8 R09: 000000000019d000 R10: 00007f7b3619e000 R11: 0000000000000003 R12: 00007f7b3626e5c0 R13: 00007ffc6db971a8 R14: 00007f7b361aadd0 R15: 00007f7b3619e000 Allocated by task 4941: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] xpad_probe+0x3eb/0x1b40 drivers/input/joystick/xpad.c:1786 usb_probe_interface+0x5c0/0xaf0 drivers/usb/core/driver.c:396 really_probe+0x24e/0xb60 drivers/base/dd.c:595 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755 driver_probe_device+0x50/0x420 drivers/base/dd.c:785 __device_attach_driver+0x2b9/0x500 drivers/base/dd.c:907 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427 __device_attach+0x359/0x570 drivers/base/dd.c:979 bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487 device_add+0xb48/0xfd0 drivers/base/core.c:3412 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+0x24e/0xb60 drivers/base/dd.c:595 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755 driver_probe_device+0x50/0x420 drivers/base/dd.c:785 __device_attach_driver+0x2b9/0x500 drivers/base/dd.c:907 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427 __device_attach+0x359/0x570 drivers/base/dd.c:979 bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487 device_add+0xb48/0xfd0 drivers/base/core.c:3412 usb_new_device+0xc17/0x18e0 drivers/usb/core/hub.c:2593 hub_port_connect drivers/usb/core/hub.c:5455 [inline] hub_port_connect_change drivers/usb/core/hub.c:5595 [inline] port_event drivers/usb/core/hub.c:5741 [inline] hub_event+0x2cdf/0x54c0 drivers/usb/core/hub.c:5823 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Freed by task 4685: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xf1/0x270 mm/slub.c:4559 xpad_disconnect+0x355/0x480 drivers/input/joystick/xpad.c:1934 usb_unbind_interface+0x1cd/0x840 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1229 [inline] device_release_driver_internal+0x50e/0x7f0 drivers/base/dd.c:1262 bus_remove_device+0x2e5/0x400 drivers/base/bus.c:529 device_del+0x6e2/0xbd0 drivers/base/core.c:3600 usb_disable_device+0x3b8/0x840 drivers/usb/core/message.c:1414 usb_disconnect+0x33c/0x8c0 drivers/usb/core/hub.c:2248 hub_port_connect drivers/usb/core/hub.c:5299 [inline] hub_port_connect_change drivers/usb/core/hub.c:5595 [inline] port_event drivers/usb/core/hub.c:5741 [inline] hub_event+0x1d58/0x54c0 drivers/usb/core/hub.c:5823 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3596 batadv_hardif_release net/batman-adv/hard-interface.c:54 [inline] kref_put include/linux/kref.h:65 [inline] batadv_hardif_put net/batman-adv/hard-interface.h:95 [inline] batadv_hard_if_event+0x899/0x17a0 net/batman-adv/hard-interface.c:1008 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2018 [inline] call_netdevice_notifiers_extack net/core/dev.c:2030 [inline] call_netdevice_notifiers net/core/dev.c:2044 [inline] unregister_netdevice_many+0xf1b/0x18f0 net/core/dev.c:11094 default_device_exit_batch+0x390/0x3f0 net/core/dev.c:11627 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x763/0xb60 net/core/net_namespace.c:599 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff88807833a000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 92 bytes inside of 1024-byte region [ffff88807833a000, ffff88807833a400) The buggy address belongs to the page: page:ffffea0001e0ce00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78338 head:ffffea0001e0ce00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001da8c00 0000000200000002 ffff888011c41dc0 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 3607, ts 346194263053, free_ts 346143341997 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node+0x1fa/0x390 mm/slub.c:4451 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x80/0x140 mm/util.c:619 kvmalloc include/linux/mm.h:805 [inline] kvzalloc include/linux/mm.h:813 [inline] bucket_table_alloc lib/rhashtable.c:184 [inline] rhashtable_init+0x554/0xa80 lib/rhashtable.c:1061 br_mdb_hash_init+0x4e/0x80 net/bridge/br_multicast.c:4943 br_dev_init+0x1ab/0x380 net/bridge/br_device.c:132 register_netdevice+0x5fe/0x1720 net/core/dev.c:10287 br_dev_newlink+0x23/0x100 net/bridge/br_netlink.c:1443 __rtnl_newlink net/core/rtnetlink.c:3501 [inline] rtnl_newlink+0x14bd/0x2070 net/core/rtnetlink.c:3549 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5629 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline] netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1352 netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1920 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 do_slab_free mm/slub.c:3487 [inline] ___cache_free+0xe3/0x100 mm/slub.c:3506 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xdb/0x750 fs/kernfs/dir.c:593 kernfs_new_node+0x136/0x230 fs/kernfs/dir.c:669 __kernfs_create_file+0x45/0x2e0 fs/kernfs/file.c:985 sysfs_add_file_mode_ns+0x308/0x3e0 fs/sysfs/file.c:317 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x573/0xf00 fs/sysfs/group.c:149 internal_create_groups fs/sysfs/group.c:189 [inline] sysfs_create_groups+0x52/0x110 fs/sysfs/group.c:215 device_add_groups drivers/base/core.c:2491 [inline] device_add_attrs+0x13c/0x470 drivers/base/core.c:2650 device_add+0x63e/0xfd0 drivers/base/core.c:3363 Memory state around the buggy address: ffff888078339f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888078339f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807833a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807833a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807833a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 89 e6 mov %esp,%esi 2: ba 01 00 00 00 mov $0x1,%edx 7: 44 89 f9 mov %r15d,%ecx a: e8 b1 19 00 00 call 0x19c0 f: 48 85 c0 test %rax,%rax 12: 74 77 je 0x8b 14: 49 89 c5 mov %rax,%r13 17: 41 b0 01 mov $0x1,%r8b 1a: 49 8b 45 00 mov 0x0(%r13),%rax 1e: 65 48 03 05 2a c3 38 add %gs:0x7e38c32a(%rip),%rax # 0x7e38c350 25: 7e 26: 48 8b 50 08 mov 0x8(%rax),%rdx * 2a: 48 8b 28 mov (%rax),%rbp <-- trapping instruction 2d: 48 85 ed test %rbp,%rbp 30: 0f 84 f0 00 00 00 je 0x126 36: 48 83 78 10 00 cmpq $0x0,0x10(%rax) 3b: 0f .byte 0xf 3c: 84 e5 test %ah,%ch