xpad 3-1:179.65: xpad_irq_in - usb_submit_urb failed with result -19 xpad 3-1:179.65: xpad_irq_out - usb_submit_urb failed with result -19 ================================================================== BUG: KASAN: slab-use-after-free in register_lock_class+0x8d1/0x980 kernel/locking/lockdep.c:1333 Read of size 1 at addr ffff888024de0891 by task udevd/4535 CPU: 1 PID: 4535 Comm: udevd Not tainted 6.9.0-rc1-next-20240328-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 register_lock_class+0x8d1/0x980 kernel/locking/lockdep.c:1333 __lock_acquire+0xda/0x1fd0 kernel/locking/lockdep.c:5014 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 __wake_up_common_lock+0x25/0x1e0 kernel/sched/wait.c:105 __usb_hcd_giveback_urb+0x3ac/0x530 drivers/usb/core/hcd.c:1651 dummy_timer+0x833/0x45f0 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x18e/0x650 kernel/time/timer.c:1793 expire_timers kernel/time/timer.c:1844 [inline] __run_timers kernel/time/timer.c:2418 [inline] __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2429 run_timer_base kernel/time/timer.c:2438 [inline] run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2448 __do_softirq+0x2c6/0x980 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x57/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0033:0x7f98b56ae03a Code: 08 eb 07 e8 85 c6 00 00 eb ec 48 8b 85 88 00 00 00 ff 40 04 44 8b 65 00 41 0f ba e4 0d 73 0d 48 89 ef e8 4e 93 00 00 41 89 c4 08 41 c1 e4 1a 41 c1 fc 1f 0f ba 65 00 0f 72 24 48 8b bd 88 00 RSP: 002b:00007fff93506aa0 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 00007f98b5bbac80 RCX: 00000000000000ff RDX: 00000000fbad2418 RSI: 00005648fe74d010 RDI: 00005648fe791620 RBP: 00005648fe791620 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000010f R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 00005648f9b68fc1 Allocated by task 4497: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace_noprof+0x19c/0x2b0 mm/slub.c:4079 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:775 [inline] xpad_probe+0x3c8/0x1b90 drivers/input/joystick/xpad.c:2021 usb_probe_interface+0x645/0xbb0 drivers/usb/core/driver.c:399 really_probe+0x2b8/0xad0 drivers/base/dd.c:656 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:798 driver_probe_device+0x50/0x430 drivers/base/dd.c:828 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:956 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:457 __device_attach+0x333/0x520 drivers/base/dd.c:1028 bus_probe_device+0x189/0x260 drivers/base/bus.c:532 device_add+0x856/0xbf0 drivers/base/core.c:3712 usb_set_configuration+0x1976/0x1fb0 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0x88/0x140 drivers/usb/core/generic.c:254 usb_probe_device+0x1b8/0x380 drivers/usb/core/driver.c:294 really_probe+0x2b8/0xad0 drivers/base/dd.c:656 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:798 driver_probe_device+0x50/0x430 drivers/base/dd.c:828 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:956 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:457 __device_attach+0x333/0x520 drivers/base/dd.c:1028 bus_probe_device+0x189/0x260 drivers/base/bus.c:532 device_add+0x856/0xbf0 drivers/base/core.c:3712 usb_new_device+0x104a/0x19a0 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+0x2d6a/0x5150 drivers/usb/core/hub.c:5903 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Freed by task 5527: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2180 [inline] slab_free mm/slub.c:4363 [inline] kfree+0x149/0x350 mm/slub.c:4484 xpad_disconnect+0x359/0x490 drivers/input/joystick/xpad.c:2202 usb_unbind_interface+0x25e/0x940 drivers/usb/core/driver.c:461 device_remove drivers/base/dd.c:568 [inline] __device_release_driver drivers/base/dd.c:1270 [inline] device_release_driver_internal+0x503/0x7c0 drivers/base/dd.c:1293 bus_remove_device+0x34f/0x420 drivers/base/bus.c:574 device_del+0x57a/0x9b0 drivers/base/core.c:3901 usb_disable_device+0x3bf/0x850 drivers/usb/core/message.c:1418 usb_disconnect+0x340/0x950 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+0x1eb9/0x5150 drivers/usb/core/hub.c:5903 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 The buggy address belongs to the object at ffff888024de0800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of freed 1024-byte region [ffff888024de0800, ffff888024de0c00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x24de0 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff80000000040(head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000040 ffff888015041dc0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff80000000040 ffff888015041dc0 dead000000000122 0000000000000000 head: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff80000000003 ffffea0000937801 ffffea0000937848 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 50, tgid 15339077 (kworker/u8:3), ts 50, free_ts 163217529798 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1487 prep_new_page mm/page_alloc.c:1495 [inline] get_page_from_freelist+0x2e8a/0x2f40 mm/page_alloc.c:3454 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4712 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2249 allocate_slab+0x5a/0x2e0 mm/slub.c:2412 new_slab mm/slub.c:2465 [inline] ___slab_alloc+0xea8/0x1430 mm/slub.c:3599 __slab_alloc+0x58/0xa0 mm/slub.c:3684 __slab_alloc_node mm/slub.c:3737 [inline] slab_alloc_node mm/slub.c:3915 [inline] __do_kmalloc_node mm/slub.c:4047 [inline] __kmalloc_noprof+0x25e/0x410 mm/slub.c:4061 kmalloc_noprof include/linux/slab.h:664 [inline] kzalloc_noprof include/linux/slab.h:775 [inline] neigh_alloc net/core/neighbour.c:494 [inline] ___neigh_create+0x691/0x2470 net/core/neighbour.c:648 ip6_finish_output2+0x1629/0x1670 net/ipv6/ip6_output.c:128 ip6_finish_output+0x41e/0x810 net/ipv6/ip6_output.c:222 NF_HOOK include/linux/netfilter.h:314 [inline] ndisc_send_skb+0xab0/0x1380 net/ipv6/ndisc.c:509 ndisc_send_ns+0xcc/0x160 net/ipv6/ndisc.c:667 addrconf_dad_work+0xb45/0x16f0 net/ipv6/addrconf.c:4279 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 page last free pid 7932 tgid 7932 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1110 [inline] free_unref_page+0xd3c/0xec0 mm/page_alloc.c:2617 __folio_put_large+0x168/0x1d0 mm/swap.c:132 __folio_put+0x299/0x390 mm/swap.c:140 page_to_skb+0x3dc/0x9b0 drivers/net/virtio_net.c:671 receive_mergeable drivers/net/virtio_net.c:1699 [inline] receive_buf+0x3b3/0x3890 drivers/net/virtio_net.c:1820 virtnet_receive drivers/net/virtio_net.c:2126 [inline] virtnet_poll+0x850/0x1ad0 drivers/net/virtio_net.c:2219 __napi_poll+0xcb/0x490 net/core/dev.c:6679 napi_poll net/core/dev.c:6748 [inline] net_rx_action+0x7bb/0x10a0 net/core/dev.c:6864 __do_softirq+0x2c6/0x980 kernel/softirq.c:554 Memory state around the buggy address: ffff888024de0780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888024de0800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888024de0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888024de0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888024de0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================