kobject: kobject_add_internal failed for event3 (error: -2 parent: input80) input: failed to attach handler evdev to device input80, error: -2 ================================================================== BUG: KASAN: slab-use-after-free in steam_input_register+0xb55/0xe10 drivers/hid/hid-steam.c:832 Write of size 8 at addr ffff88801e6cb120 by task kworker/0:1/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.13.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Workqueue: events steam_work_unregister_cb Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x108/0x280 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 steam_input_register+0xb55/0xe10 drivers/hid/hid-steam.c:832 steam_work_unregister_cb+0x156/0x190 drivers/hid/hid-steam.c:1095 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0x947/0x1410 kernel/workqueue.c:3317 worker_thread+0x868/0xc70 kernel/workqueue.c:3398 kthread+0x647/0x750 kernel/kthread.c:464 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 38: 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:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4298 [inline] __kmalloc_node_track_caller_noprof+0x282/0x520 mm/slub.c:4317 alloc_dr drivers/base/devres.c:119 [inline] devm_kmalloc+0x77/0x2a0 drivers/base/devres.c:830 devm_kzalloc include/linux/device.h:328 [inline] steam_probe+0xa0/0xc70 drivers/hid/hid-steam.c:1241 __hid_device_probe drivers/hid/hid-core.c:2713 [inline] hid_device_probe+0x388/0x640 drivers/hid/hid-core.c:2750 really_probe+0x2de/0x930 drivers/base/dd.c:658 __driver_probe_device+0x138/0x310 drivers/base/dd.c:800 driver_probe_device+0x4b/0x3a0 drivers/base/dd.c:830 __device_attach_driver+0x2d0/0x400 drivers/base/dd.c:958 bus_for_each_drv+0x215/0x280 drivers/base/bus.c:459 __device_attach+0x248/0x430 drivers/base/dd.c:1030 bus_probe_device+0x12e/0x210 drivers/base/bus.c:534 device_add+0x540/0x990 drivers/base/core.c:3665 hid_add_device+0x2cf/0x430 drivers/hid/hid-core.c:2896 usbhid_probe+0xb3a/0xf30 drivers/hid/usbhid/hid-core.c:1431 usb_probe_interface+0x478/0x9a0 drivers/usb/core/driver.c:396 really_probe+0x2de/0x930 drivers/base/dd.c:658 __driver_probe_device+0x138/0x310 drivers/base/dd.c:800 driver_probe_device+0x4b/0x3a0 drivers/base/dd.c:830 __device_attach_driver+0x2d0/0x400 drivers/base/dd.c:958 bus_for_each_drv+0x215/0x280 drivers/base/bus.c:459 __device_attach+0x248/0x430 drivers/base/dd.c:1030 bus_probe_device+0x12e/0x210 drivers/base/bus.c:534 device_add+0x540/0x990 drivers/base/core.c:3665 usb_set_configuration+0x17f8/0x1dc0 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0x65/0x100 drivers/usb/core/generic.c:254 usb_probe_device+0xd5/0x290 drivers/usb/core/driver.c:291 really_probe+0x2de/0x930 drivers/base/dd.c:658 __driver_probe_device+0x138/0x310 drivers/base/dd.c:800 driver_probe_device+0x4b/0x3a0 drivers/base/dd.c:830 __device_attach_driver+0x2d0/0x400 drivers/base/dd.c:958 bus_for_each_drv+0x215/0x280 drivers/base/bus.c:459 __device_attach+0x248/0x430 drivers/base/dd.c:1030 bus_probe_device+0x12e/0x210 drivers/base/bus.c:534 device_add+0x540/0x990 drivers/base/core.c:3665 usb_new_device+0xc78/0x17f0 drivers/usb/core/hub.c:2651 hub_port_connect drivers/usb/core/hub.c:5523 [inline] hub_port_connect_change drivers/usb/core/hub.c:5663 [inline] port_event drivers/usb/core/hub.c:5823 [inline] hub_event+0x2341/0x41e0 drivers/usb/core/hub.c:5905 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0x947/0x1410 kernel/workqueue.c:3317 worker_thread+0x868/0xc70 kernel/workqueue.c:3398 kthread+0x647/0x750 kernel/kthread.c:464 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 38: 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:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x17c/0x3d0 mm/slub.c:4761 release_nodes drivers/base/devres.c:506 [inline] devres_release_group+0x24a/0x300 drivers/base/devres.c:689 hid_device_remove+0x201/0x320 drivers/hid/hid-core.c:2774 device_remove drivers/base/dd.c:567 [inline] __device_release_driver drivers/base/dd.c:1273 [inline] device_release_driver_internal+0x3e7/0x6a0 drivers/base/dd.c:1296 bus_remove_device+0x2d3/0x380 drivers/base/bus.c:576 device_del+0x434/0x730 drivers/base/core.c:3854 hid_remove_device drivers/hid/hid-core.c:2953 [inline] hid_destroy_device+0x4b/0x170 drivers/hid/hid-core.c:2975 usbhid_disconnect+0x94/0xb0 drivers/hid/usbhid/hid-core.c:1458 usb_unbind_interface+0x1c1/0x7f0 drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] __device_release_driver drivers/base/dd.c:1273 [inline] device_release_driver_internal+0x43c/0x6a0 drivers/base/dd.c:1296 bus_remove_device+0x2d3/0x380 drivers/base/bus.c:576 device_del+0x434/0x730 drivers/base/core.c:3854 usb_disable_device+0x2d7/0x640 drivers/usb/core/message.c:1418 usb_disconnect+0x2be/0x820 drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5363 [inline] hub_port_connect_change drivers/usb/core/hub.c:5663 [inline] port_event drivers/usb/core/hub.c:5823 [inline] hub_event+0x17a5/0x41e0 drivers/usb/core/hub.c:5905 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0x947/0x1410 kernel/workqueue.c:3317 worker_thread+0x868/0xc70 kernel/workqueue.c:3398 kthread+0x647/0x750 kernel/kthread.c:464 ret_from_fork+0x32/0x60 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:544 insert_work+0x38/0x230 kernel/workqueue.c:2183 __queue_work+0x88a/0xa80 kernel/workqueue.c:2339 queue_work_on+0x123/0x1f0 kernel/workqueue.c:2390 hid_hw_close+0x87/0xb0 drivers/hid/hid-core.c:2415 drop_ref drivers/hid/hidraw.c:360 [inline] hidraw_release+0x409/0x560 drivers/hid/hidraw.c:384 __fput+0x1aa/0x7a0 fs/file_table.c:450 task_work_run+0x20f/0x290 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xa3/0x1d0 kernel/entry/common.c:218 do_syscall_64+0x9a/0x190 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:544 insert_work+0x38/0x230 kernel/workqueue.c:2183 __queue_work+0x88a/0xa80 kernel/workqueue.c:2339 queue_work_on+0x123/0x1f0 kernel/workqueue.c:2390 queue_work include/linux/workqueue.h:662 [inline] schedule_work include/linux/workqueue.h:723 [inline] steam_client_ll_open+0xac/0xc0 drivers/hid/hid-steam.c:1146 hid_hw_open+0xaf/0x130 drivers/hid/hid-core.c:2392 hidraw_open+0x1e0/0x520 drivers/hid/hidraw.c:308 chrdev_open+0x47d/0x540 fs/char_dev.c:414 do_dentry_open+0x7da/0x1620 fs/open.c:938 vfs_open+0x36/0x290 fs/open.c:1068 do_open fs/namei.c:3828 [inline] path_openat+0x233f/0x29f0 fs/namei.c:3987 do_filp_open+0x274/0x480 fs/namei.c:4014 do_sys_openat2+0xf6/0x180 fs/open.c:1395 do_sys_open fs/open.c:1410 [inline] __do_sys_openat fs/open.c:1426 [inline] __se_sys_openat fs/open.c:1421 [inline] __x64_sys_openat+0x20d/0x260 fs/open.c:1421 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x190 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88801e6cb000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 288 bytes inside of freed 1024-byte region [ffff88801e6cb000, ffff88801e6cb400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1e6c8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff888011c41dc0 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff888011c41dc0 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea000079b201 ffffffffffffffff 0000000000000000 head: 0000000000000008 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4488, tgid 4488 (syz-executor), ts 70014327819, free_ts 68715208595 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x10f/0x130 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x3229/0x3370 mm/page_alloc.c:3476 __alloc_pages_noprof+0x256/0x650 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x291/0x560 mm/mempolicy.c:2269 alloc_slab_page+0x6a/0x110 mm/slub.c:2423 allocate_slab+0x5d/0x260 mm/slub.c:2589 new_slab mm/slub.c:2642 [inline] ___slab_alloc+0x9f6/0x1130 mm/slub.c:3830 __slab_alloc mm/slub.c:3920 [inline] __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_noprof+0x309/0x530 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] ops_init+0x6f/0x3f0 net/core/net_namespace.c:128 setup_net+0x306/0x880 net/core/net_namespace.c:362 copy_net_ns+0x27d/0x460 net/core/net_namespace.c:516 create_new_namespaces+0x381/0x660 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xd8/0x120 kernel/nsproxy.c:228 ksys_unshare+0x3dd/0x840 kernel/fork.c:3330 __do_sys_unshare kernel/fork.c:3401 [inline] __se_sys_unshare kernel/fork.c:3399 [inline] __x64_sys_unshare+0x33/0x40 kernel/fork.c:3399 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x190 arch/x86/entry/common.c:83 page last free pid 4463 tgid 4457 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0xc34/0xea0 mm/page_alloc.c:2659 __folio_put+0x234/0x2c0 mm/swap.c:112 skb_page_unref include/linux/skbuff_ref.h:43 [inline] __skb_frag_unref include/linux/skbuff_ref.h:56 [inline] skb_release_data+0x3ea/0x7b0 net/core/skbuff.c:1119 skb_release_all net/core/skbuff.c:1190 [inline] __kfree_skb+0x48/0x50 net/core/skbuff.c:1204 tcp_clean_rtx_queue net/ipv4/tcp_input.c:3436 [inline] tcp_ack+0x1745/0x6210 net/ipv4/tcp_input.c:4032 tcp_rcv_established+0xd98/0x1f50 net/ipv4/tcp_input.c:6191 tcp_v4_do_rcv+0x230/0xa80 net/ipv4/tcp_ipv4.c:1918 tcp_v4_rcv+0x21df/0x2c10 net/ipv4/tcp_ipv4.c:2353 ip_protocol_deliver_rcu+0x375/0x970 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x20c/0x430 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] ip_local_deliver+0x198/0x3b0 net/ipv4/ip_input.c:254 NF_HOOK include/linux/netfilter.h:314 [inline] ip_rcv+0xc9/0x260 net/ipv4/ip_input.c:567 __netif_receive_skb_one_core net/core/dev.c:5828 [inline] __netif_receive_skb+0x257/0x580 net/core/dev.c:5941 process_backlog+0x47f/0xbd0 net/core/dev.c:6289 __napi_poll+0xa1/0x500 net/core/dev.c:7106 napi_poll net/core/dev.c:7175 [inline] net_rx_action+0x748/0x1090 net/core/dev.c:7297 Memory state around the buggy address: ffff88801e6cb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801e6cb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801e6cb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801e6cb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801e6cb200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================