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 register_lock_class+0xe6a/0x1120 kernel/locking/lockdep.c:1338 Read of size 1 at addr ffff88801fb26091 by task udevd/4433 CPU: 0 PID: 4433 Comm: udevd Not tainted 6.2.0-rc6-syzkaller-00003-g22b8077d0fce #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517 register_lock_class+0xe6a/0x1120 kernel/locking/lockdep.c:1338 __lock_acquire+0x109/0x56d0 kernel/locking/lockdep.c:4934 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3d/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+0x1203/0x32d0 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1700 expire_timers+0x2c6/0x5c0 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+0x1fb/0xadc kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 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:649 RIP: 0010:unwind_done arch/x86/include/asm/unwind.h:50 [inline] RIP: 0010:unwind_get_return_address+0x12/0xa0 arch/x86/kernel/unwind_orc.c:339 Code: ff ff ff e8 d0 db 96 00 eb b4 e8 c9 db 96 00 eb 80 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 b8 00 00 00 00 00 fc ff df 48 89 fa 55 <48> c1 ea 03 53 48 89 fb 0f b6 04 02 84 c0 74 04 3c 03 7e 51 8b 03 RSP: 0018:ffffc9000314f5e8 EFLAGS: 00000202 RAX: dffffc0000000000 RBX: ffffffff816fafc0 RCX: 0000000000000000 RDX: ffffc9000314f5f8 RSI: ffffc9000314f990 RDI: ffffc9000314f5f8 RBP: ffffc9000314f680 R08: ffffffff8f02f232 R09: ffffc9000314f62c R10: fffff52000629eca R11: ffffc9000314f9b8 R12: ffffc9000314f6b0 R13: 0000000000000000 R14: ffff88807d338000 R15: 0000000000000cc0 arch_stack_walk+0x97/0xf0 arch/x86/kernel/stacktrace.c:26 stack_trace_save+0x90/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x82/0x90 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] kmem_cache_alloc_node+0x1f1/0x460 mm/slub.c:3497 __alloc_skb+0x216/0x310 net/core/skbuff.c:552 alloc_skb include/linux/skbuff.h:1270 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1211 [inline] netlink_sendmsg+0x9a6/0xe10 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0360f35163 Code: 64 89 02 48 c7 c0 ff ff ff ff eb b7 66 2e 0f 1f 84 00 00 00 00 00 90 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 89 54 24 1c 48 RSP: 002b:00007ffdf8bba5c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00005641ada01dc0 RCX: 00007f0360f35163 RDX: 0000000000000000 RSI: 00007ffdf8bba5d8 RDI: 0000000000000004 RBP: 00005641ada02230 R08: 0000000000000001 R09: 00005641ada35ca0 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000072 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 23236: 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:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] xpad_probe+0x275/0x1ed0 drivers/input/joystick/xpad.c:1954 usb_probe_interface+0x30f/0x7f0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:560 [inline] really_probe+0x249/0xb90 drivers/base/dd.c:639 __driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:778 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:808 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:936 bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:427 __device_attach+0x1e4/0x530 drivers/base/dd.c:1008 bus_probe_device+0x1e8/0x2a0 drivers/base/bus.c:487 device_add+0xbd9/0x1e90 drivers/base/core.c:3479 usb_set_configuration+0x101d/0x1900 drivers/usb/core/message.c:2171 usb_generic_driver_probe+0xbe/0x100 drivers/usb/core/generic.c:238 usb_probe_device+0xd8/0x2c0 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:560 [inline] really_probe+0x249/0xb90 drivers/base/dd.c:639 __driver_probe_device+0x1df/0x4d0 drivers/base/dd.c:778 driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:808 __device_attach_driver+0x1d4/0x2e0 drivers/base/dd.c:936 bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:427 __device_attach+0x1e4/0x530 drivers/base/dd.c:1008 bus_probe_device+0x1e8/0x2a0 drivers/base/bus.c:487 device_add+0xbd9/0x1e90 drivers/base/core.c:3479 usb_new_device.cold+0x685/0x10ad drivers/usb/core/hub.c:2576 hub_port_connect drivers/usb/core/hub.c:5408 [inline] hub_port_connect_change drivers/usb/core/hub.c:5552 [inline] port_event drivers/usb/core/hub.c:5712 [inline] hub_event+0x2d5c/0x4810 drivers/usb/core/hub.c:5794 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 23058: 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:518 ____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:177 [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/0x3b0 mm/slub.c:3800 xpad_disconnect+0x1cf/0x540 drivers/input/joystick/xpad.c:2135 usb_unbind_interface+0x1dc/0x8e0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:550 [inline] device_remove+0x11f/0x170 drivers/base/dd.c:542 __device_release_driver drivers/base/dd.c:1253 [inline] device_release_driver_internal+0x4a5/0x700 drivers/base/dd.c:1279 bus_remove_device+0x2e7/0x5a0 drivers/base/bus.c:529 device_del+0x4f7/0xc80 drivers/base/core.c:3666 usb_disable_device+0x35a/0x7b0 drivers/usb/core/message.c:1420 usb_disconnect.cold+0x259/0x6ed drivers/usb/core/hub.c:2238 hub_port_connect drivers/usb/core/hub.c:5247 [inline] hub_port_connect_change drivers/usb/core/hub.c:5552 [inline] port_event drivers/usb/core/hub.c:5712 [inline] hub_event+0x1fb5/0x4810 drivers/usb/core/hub.c:5794 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 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:488 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3376 neigh_destroy+0x435/0x640 net/core/neighbour.c:931 neigh_release include/net/neighbour.h:449 [inline] neigh_cleanup_and_release+0x271/0x3d0 net/core/neighbour.c:103 neigh_flush_dev+0x4e7/0x820 net/core/neighbour.c:411 neigh_changeaddr+0x30/0x40 net/core/neighbour.c:419 arp_netdev_event+0x61/0x380 net/ipv4/arp.c:1281 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers net/core/dev.c:1996 [inline] dev_set_mac_address+0x2d7/0x3e0 net/core/dev.c:8791 alb_set_slave_mac_addr+0x173/0x220 drivers/net/bonding/bond_alb.c:1037 bond_alb_init_slave+0xe4/0xb30 drivers/net/bonding/bond_alb.c:1638 bond_enslave+0x218e/0x5350 drivers/net/bonding/bond_main.c:1977 do_set_master+0x1c8/0x220 net/core/rtnetlink.c:2617 rtnl_newlink_create net/core/rtnetlink.c:3424 [inline] __rtnl_newlink+0x13f2/0x1840 net/core/rtnetlink.c:3624 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3637 rtnetlink_rcv_msg+0x43e/0xca0 net/core/rtnetlink.c:6141 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2574 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Second to 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:488 __call_rcu_common.constprop.0+0x99/0x820 kernel/rcu/tree.c:2755 sctp_transport_destroy net/sctp/transport.c:171 [inline] sctp_transport_put+0x121/0x180 net/sctp/transport.c:483 sctp_association_free+0x4d0/0x7d0 net/sctp/associola.c:379 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1328 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline] sctp_do_sm+0x33ff/0x5290 net/sctp/sm_sideeffect.c:1170 sctp_assoc_bh_rcv+0x38a/0x6c0 net/sctp/associola.c:1051 sctp_inq_push+0x1d6/0x270 net/sctp/inqueue.c:80 sctp_backlog_rcv+0x19a/0x5b0 net/sctp/input.c:331 sk_backlog_rcv include/net/sock.h:1113 [inline] __release_sock+0x133/0x3b0 net/core/sock.c:2928 release_sock+0x58/0x1b0 net/core/sock.c:3485 sctp_close+0x446/0x940 net/sctp/socket.c:1534 inet_release+0x132/0x270 net/ipv4/af_inet.c:428 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:489 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x1c/0x20 net/socket.c:1365 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0x16f/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 The buggy address belongs to the object at ffff88801fb26000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 145 bytes inside of 1024-byte region [ffff88801fb26000, ffff88801fb26400) The buggy address belongs to the physical page: page:ffffea00007ec800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1fb20 head:ffffea00007ec800 order:3 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012441dc0 dead000000000100 dead000000000122 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5065, tgid 5060 (syz-fuzzer), ts 86937913205, free_ts 86937748098 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2286 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x350 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+0x1a4/0x430 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc_node_track_caller+0x4b/0xc0 mm/slab_common.c:988 kmalloc_reserve net/core/skbuff.c:492 [inline] __alloc_skb+0xe9/0x310 net/core/skbuff.c:565 alloc_skb include/linux/skbuff.h:1270 [inline] __tcp_send_ack.part.0+0x67/0x760 net/ipv4/tcp_output.c:3957 __tcp_send_ack net/ipv4/tcp_output.c:3989 [inline] tcp_send_ack+0x81/0xa0 net/ipv4/tcp_output.c:3989 __tcp_ack_snd_check+0x156/0x9c0 net/ipv4/tcp_input.c:5536 tcp_rcv_established+0x1bc7/0x2230 net/ipv4/tcp_input.c:5980 tcp_v4_do_rcv+0x670/0x9b0 net/ipv4/tcp_ipv4.c:1721 tcp_v4_rcv+0x2eab/0x3280 net/ipv4/tcp_ipv4.c:2142 ip_protocol_deliver_rcu+0x9f/0x460 net/ipv4/ip_input.c:205 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3464 skb_free_frag include/linux/skbuff.h:3193 [inline] skb_free_head+0x96/0x110 net/core/skbuff.c:820 skb_release_data+0x5f4/0x870 net/core/skbuff.c:851 skb_release_all net/core/skbuff.c:916 [inline] __kfree_skb net/core/skbuff.c:930 [inline] skb_attempt_defer_free+0x309/0x3e0 net/core/skbuff.c:6708 tcp_eat_recv_skb net/ipv4/tcp.c:1639 [inline] tcp_recvmsg_locked+0x124e/0x22b0 net/ipv4/tcp.c:2634 tcp_recvmsg+0x117/0x620 net/ipv4/tcp.c:2680 inet_recvmsg+0x114/0x5e0 net/ipv4/af_inet.c:861 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] sock_read_iter+0x348/0x480 net/socket.c:1086 call_read_iter include/linux/fs.h:2183 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x7fa/0x930 fs/read_write.c:470 ksys_read+0x1ec/0x250 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88801fb25f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801fb26000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801fb26080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801fb26100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801fb26180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 3 bytes skipped: 0: e8 d0 db 96 00 callq 0x96dbd5 5: eb b4 jmp 0xffffffbb 7: e8 c9 db 96 00 callq 0x96dbd5 c: eb 80 jmp 0xffffff8e e: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 15: f3 0f 1e fa endbr64 19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 20: fc ff df 23: 48 89 fa mov %rdi,%rdx 26: 55 push %rbp * 27: 48 c1 ea 03 shr $0x3,%rdx <-- trapping instruction 2b: 53 push %rbx 2c: 48 89 fb mov %rdi,%rbx 2f: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax 33: 84 c0 test %al,%al 35: 74 04 je 0x3b 37: 3c 03 cmp $0x3,%al 39: 7e 51 jle 0x8c 3b: 8b 03 mov (%rbx),%eax