xpad 8-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 8-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19 ================================================================== BUG: KASAN: slab-use-after-free in register_lock_class+0x101f/0x1230 kernel/locking/lockdep.c:1333 Read of size 1 at addr ffff88802e035091 by task swapper/0/0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.9.0-rc3-syzkaller-00023-g2c71fdf02a95 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 register_lock_class+0x101f/0x1230 kernel/locking/lockdep.c:1333 __lock_acquire+0x111/0x3b30 kernel/locking/lockdep.c:5014 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 __wake_up_common_lock kernel/sched/wait.c:105 [inline] __wake_up+0x1c/0x60 kernel/sched/wait.c:127 __usb_unanchor_urb drivers/usb/core/urb.c:156 [inline] usb_anchor_resume_wakeups+0xc2/0xe0 drivers/usb/core/urb.c:150 __usb_hcd_giveback_urb+0x392/0x5c0 drivers/usb/core/hcd.c:1651 usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1732 dummy_timer+0x17fc/0x3940 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x1a0/0x610 kernel/time/timer.c:1793 expire_timers kernel/time/timer.c:1844 [inline] __run_timers+0x74b/0xaf0 kernel/time/timer.c:2418 __run_timer_base kernel/time/timer.c:2429 [inline] __run_timer_base kernel/time/timer.c:2422 [inline] run_timer_base+0x111/0x190 kernel/time/timer.c:2438 run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2448 __do_softirq+0x218/0x922 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:633 [inline] irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:37 [inline] RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:72 [inline] RIP: 0010:default_idle+0xf/0x20 arch/x86/kernel/process.c:743 Code: 4c 01 c7 4c 29 c2 e9 72 ff ff ff 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 66 90 0f 00 2d b3 0b 2c 00 fb f4 c3 cc cc cc cc 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 RSP: 0018:ffffffff8d407e20 EFLAGS: 00000242 RAX: 00000000000d7c9d RBX: 0000000000000000 RCX: ffffffff8ada7659 RDX: 0000000000000000 RSI: ffffffff8b0cae80 RDI: ffffffff8b6f4c60 RBP: fffffbfff1a92ae8 R08: 0000000000000001 R09: ffffed100d646fdd R10: ffff88806b237eeb R11: 0000000000000000 R12: 0000000000000000 R13: ffffffff8d495740 R14: ffffffff8f9f0010 R15: 0000000000000000 default_idle_call+0x6d/0xb0 kernel/sched/idle.c:117 cpuidle_idle_call kernel/sched/idle.c:191 [inline] do_idle+0x32c/0x3f0 kernel/sched/idle.c:332 cpu_startup_entry+0x4f/0x60 kernel/sched/idle.c:430 rest_init+0x16b/0x2b0 init/main.c:732 start_kernel+0x3a3/0x490 init/main.c:1074 x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:507 x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:488 common_startup_64+0x13e/0x148 Allocated by task 5233: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] xpad_probe+0x27e/0x1f50 drivers/input/joystick/xpad.c:2021 usb_probe_interface+0x309/0x9d0 drivers/usb/core/driver.c:399 call_driver_probe drivers/base/dd.c:578 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:656 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:798 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:828 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:956 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1028 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532 device_add+0x1188/0x1ab0 drivers/base/core.c:3720 usb_set_configuration+0x10cb/0x1c50 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0xb1/0x110 drivers/usb/core/generic.c:254 usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:294 call_driver_probe drivers/base/dd.c:578 [inline] really_probe+0x23e/0xa90 drivers/base/dd.c:656 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:798 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:828 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:956 bus_for_each_drv+0x157/0x1e0 drivers/base/bus.c:457 __device_attach+0x1e8/0x4b0 drivers/base/dd.c:1028 bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:532 device_add+0x1188/0x1ab0 drivers/base/core.c:3720 usb_new_device+0xd90/0x1a10 drivers/usb/core/hub.c:2652 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+0x2db0/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 56: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x129/0x390 mm/slub.c:4390 xpad_disconnect+0x1cf/0x580 drivers/input/joystick/xpad.c:2202 usb_unbind_interface+0x1e8/0x970 drivers/usb/core/driver.c:461 device_remove drivers/base/dd.c:568 [inline] device_remove+0x122/0x170 drivers/base/dd.c:560 __device_release_driver drivers/base/dd.c:1270 [inline] device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1293 bus_remove_device+0x22f/0x420 drivers/base/bus.c:574 device_del+0x396/0xa10 drivers/base/core.c:3909 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418 usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2305 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+0x1dbb/0x4e20 drivers/usb/core/hub.c:5903 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88802e035000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of freed 1024-byte region [ffff88802e035000, ffff88802e035400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802e032800 pfn:0x2e030 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff80000000a40(workingset|slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000a40 ffff888015042dc0 ffffea00011e5810 ffffea00011f9c10 raw: ffff88802e032800 000000000010000b 00000001ffffffff 0000000000000000 head: 00fff80000000a40 ffff888015042dc0 ffffea00011e5810 ffffea00011f9c10 head: ffff88802e032800 000000000010000b 00000001ffffffff 0000000000000000 head: 00fff80000000003 ffffea0000b80c01 ffffea0000b80c48 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 10, tgid 10 (kworker/u32:0), ts 57254874218, free_ts 57241092562 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x66d/0x1790 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc+0x3b4/0x440 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] neigh_alloc net/core/neighbour.c:494 [inline] ___neigh_create+0x152b/0x2ae0 net/core/neighbour.c:648 ip6_finish_output2+0x112f/0x18b0 net/ipv6/ip6_output.c:128 __ip6_finish_output net/ipv6/ip6_output.c:211 [inline] ip6_finish_output+0x3f9/0x1300 net/ipv6/ip6_output.c:222 NF_HOOK_COND include/linux/netfilter.h:303 [inline] ip6_output+0x1eb/0x540 net/ipv6/ip6_output.c:243 dst_output include/net/dst.h:450 [inline] NF_HOOK include/linux/netfilter.h:314 [inline] ndisc_send_skb+0xa2d/0x1c30 net/ipv6/ndisc.c:509 ndisc_send_rs+0x12b/0x690 net/ipv6/ndisc.c:719 addrconf_dad_completed+0x4a1/0x1060 net/ipv6/addrconf.c:4357 addrconf_dad_work+0x807/0x1500 net/ipv6/addrconf.c:4265 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 page last free pid 56 tgid 56 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 __put_partials+0x14c/0x170 mm/slub.c:2906 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmalloc_trace+0x147/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] nsim_fib4_rt_create drivers/net/netdevsim/fib.c:280 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:426 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:464 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:884 [inline] nsim_fib_event_work+0x6b4/0x26e0 drivers/net/netdevsim/fib.c:1492 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88802e034f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802e035000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802e035080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802e035100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802e035180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 4c 01 c7 add %r8,%rdi 3: 4c 29 c2 sub %r8,%rdx 6: e9 72 ff ff ff jmp 0xffffff7d b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: f3 0f 1e fa endbr64 1f: 66 90 xchg %ax,%ax 21: 0f 00 2d b3 0b 2c 00 verw 0x2c0bb3(%rip) # 0x2c0bdb 28: fb sti 29: f4 hlt * 2a: fa cli <-- trapping instruction 2b: c3 ret 2c: cc int3 2d: cc int3 2e: cc int3 2f: cc int3 30: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) 37: 00 00 00 00 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 90 nop 3f: 90 nop