================================================================== BUG: KASAN: slab-use-after-free in steam_input_open+0x5d/0x120 drivers/hid/hid-steam.c:604 Read of size 8 at addr ffff88805bb96930 by task acpid/5194 CPU: 0 UID: 0 PID: 5194 Comm: acpid Not tainted 6.14.0-rc3-syzkaller-00137-g27eddbf34490 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 steam_input_open+0x5d/0x120 drivers/hid/hid-steam.c:604 input_open_device+0x1eb/0x360 drivers/input/input.c:600 joydev_open_device drivers/input/joydev.c:207 [inline] joydev_open+0x310/0x940 drivers/input/joydev.c:272 chrdev_open+0x521/0x600 fs/char_dev.c:414 do_dentry_open+0xdec/0x1960 fs/open.c:956 vfs_open+0x3b/0x370 fs/open.c:1086 do_open fs/namei.c:3830 [inline] path_openat+0x2c81/0x3590 fs/namei.c:3989 do_filp_open+0x27f/0x4e0 fs/namei.c:4016 do_sys_openat2+0x13e/0x1d0 fs/open.c:1428 do_sys_open fs/open.c:1443 [inline] __do_sys_openat fs/open.c:1459 [inline] __se_sys_openat fs/open.c:1454 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1454 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f48394fe9a4 Code: 24 20 48 8d 44 24 30 48 89 44 24 28 64 8b 04 25 18 00 00 00 85 c0 75 2c 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 60 48 8b 15 55 a4 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007ffeb5877110 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007ffeb5877438 RCX: 00007f48394fe9a4 RDX: 0000000000080800 RSI: 00007ffeb58772f8 RDI: 00000000ffffff9c RBP: 00007ffeb58772f8 R08: 00000000000000f4 R09: 00007ffeb58772f8 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080800 R13: 0000000000000100 R14: 00007ffeb58773f8 R15: 00007ffeb58772f8 Allocated by task 975: 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:4294 [inline] __kmalloc_node_track_caller_noprof+0x28b/0x4c0 mm/slub.c:4313 alloc_dr drivers/base/devres.c:119 [inline] devm_kmalloc+0x88/0x310 drivers/base/devres.c:843 devm_kzalloc include/linux/device.h:328 [inline] steam_probe+0xc5/0xd70 drivers/hid/hid-steam.c:1241 __hid_device_probe drivers/hid/hid-core.c:2713 [inline] hid_device_probe+0x3bf/0x710 drivers/hid/hid-core.c:2750 really_probe+0x2b9/0xad0 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 driver_probe_device+0x50/0x430 drivers/base/dd.c:830 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:958 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462 __device_attach+0x333/0x520 drivers/base/dd.c:1030 bus_probe_device+0x189/0x260 drivers/base/bus.c:537 device_add+0x856/0xbf0 drivers/base/core.c:3665 hid_add_device+0x3b6/0x520 drivers/hid/hid-core.c:2896 usbhid_probe+0xd87/0x1270 drivers/hid/usbhid/hid-core.c:1431 usb_probe_interface+0x641/0xbb0 drivers/usb/core/driver.c:396 really_probe+0x2b9/0xad0 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 driver_probe_device+0x50/0x430 drivers/base/dd.c:830 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:958 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462 __device_attach+0x333/0x520 drivers/base/dd.c:1030 bus_probe_device+0x189/0x260 drivers/base/bus.c:537 device_add+0x856/0xbf0 drivers/base/core.c:3665 usb_set_configuration+0x1976/0x1fb0 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0x88/0x140 drivers/usb/core/generic.c:250 usb_probe_device+0x1b8/0x380 drivers/usb/core/driver.c:291 really_probe+0x2b9/0xad0 drivers/base/dd.c:658 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 driver_probe_device+0x50/0x430 drivers/base/dd.c:830 __device_attach_driver+0x2d6/0x530 drivers/base/dd.c:958 bus_for_each_drv+0x24e/0x2e0 drivers/base/bus.c:462 __device_attach+0x333/0x520 drivers/base/dd.c:1030 bus_probe_device+0x189/0x260 drivers/base/bus.c:537 device_add+0x856/0xbf0 drivers/base/core.c:3665 usb_new_device+0x104a/0x19a0 drivers/usb/core/hub.c:2663 hub_port_connect drivers/usb/core/hub.c:5533 [inline] hub_port_connect_change drivers/usb/core/hub.c:5673 [inline] port_event drivers/usb/core/hub.c:5833 [inline] hub_event+0x2d6d/0x5150 drivers/usb/core/hub.c:5915 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3317 worker_thread+0x870/0xd30 kernel/workqueue.c:3398 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 975: 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:576 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:4609 [inline] kfree+0x196/0x430 mm/slub.c:4757 release_nodes drivers/base/devres.c:506 [inline] devres_release_group+0x328/0x350 drivers/base/devres.c:689 hid_device_remove+0x250/0x370 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+0x4a9/0x7c0 drivers/base/dd.c:1296 bus_remove_device+0x34f/0x420 drivers/base/bus.c:579 device_del+0x57a/0x9b0 drivers/base/core.c:3854 hid_remove_device drivers/hid/hid-core.c:2953 [inline] hid_destroy_device+0x6a/0x1b0 drivers/hid/hid-core.c:2975 usbhid_disconnect+0x9e/0xc0 drivers/hid/usbhid/hid-core.c:1458 usb_unbind_interface+0x25b/0x940 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+0x503/0x7c0 drivers/base/dd.c:1296 bus_remove_device+0x34f/0x420 drivers/base/bus.c:579 device_del+0x57a/0x9b0 drivers/base/core.c:3854 usb_disable_device+0x3bf/0x850 drivers/usb/core/message.c:1418 usb_disconnect+0x340/0x950 drivers/usb/core/hub.c:2316 hub_port_connect drivers/usb/core/hub.c:5373 [inline] hub_port_connect_change drivers/usb/core/hub.c:5673 [inline] port_event drivers/usb/core/hub.c:5833 [inline] hub_event+0x1ebc/0x5150 drivers/usb/core/hub.c:5915 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3317 worker_thread+0x870/0xd30 kernel/workqueue.c:3398 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 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+0xaa/0xc0 mm/kasan/generic.c:548 insert_work+0x3e/0x330 kernel/workqueue.c:2183 __queue_work+0xc8b/0xf50 kernel/workqueue.c:2339 queue_work_on+0x1c2/0x380 kernel/workqueue.c:2390 queue_work include/linux/workqueue.h:662 [inline] schedule_work include/linux/workqueue.h:723 [inline] steam_client_ll_open+0xb1/0xc0 drivers/hid/hid-steam.c:1146 hid_hw_open+0xe3/0x170 drivers/hid/hid-core.c:2392 hidraw_open+0x298/0x8e0 drivers/hid/hidraw.c:308 chrdev_open+0x521/0x600 fs/char_dev.c:414 do_dentry_open+0xdec/0x1960 fs/open.c:956 vfs_open+0x3b/0x370 fs/open.c:1086 do_open fs/namei.c:3830 [inline] path_openat+0x2c81/0x3590 fs/namei.c:3989 do_filp_open+0x27f/0x4e0 fs/namei.c:4016 do_sys_openat2+0x13e/0x1d0 fs/open.c:1428 do_sys_open fs/open.c:1443 [inline] __do_sys_openat fs/open.c:1459 [inline] __se_sys_openat fs/open.c:1454 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1454 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 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+0xaa/0xc0 mm/kasan/generic.c:548 insert_work+0x3e/0x330 kernel/workqueue.c:2183 __queue_work+0xc8b/0xf50 kernel/workqueue.c:2339 queue_work_on+0x1c2/0x380 kernel/workqueue.c:2390 hid_hw_close+0xac/0xe0 drivers/hid/hid-core.c:2415 drop_ref drivers/hid/hidraw.c:360 [inline] hidraw_release+0x472/0x6c0 drivers/hid/hidraw.c:384 __fput+0x3e9/0x9f0 fs/file_table.c:464 task_work_run+0x24f/0x310 kernel/task_work.c:227 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+0x13f/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805bb96800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 304 bytes inside of freed 1024-byte region [ffff88805bb96800, ffff88805bb96c00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5bb90 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b041dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b041dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea00016ee401 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 5846, tgid 5846 (syz-executor), ts 68677218170, free_ts 68577477259 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4739 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_node_noprof+0x2ee/0x4d0 mm/slub.c:4300 kmalloc_node_noprof include/linux/slab.h:928 [inline] qdisc_alloc+0x9a/0xa80 net/sched/sch_generic.c:947 qdisc_create_dflt+0x62/0x4b0 net/sched/sch_generic.c:1009 attach_one_default_qdisc net/sched/sch_generic.c:1175 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2590 [inline] attach_default_qdiscs net/sched/sch_generic.c:1193 [inline] dev_activate+0x3c0/0x1240 net/sched/sch_generic.c:1252 __dev_open+0x38e/0x4a0 net/core/dev.c:1644 __dev_change_flags+0x1e2/0x6f0 net/core/dev.c:9260 dev_change_flags+0x8b/0x1a0 net/core/dev.c:9332 do_setlink+0xcca/0x4300 net/core/rtnetlink.c:3118 rtnl_changelink net/core/rtnetlink.c:3733 [inline] __rtnl_newlink net/core/rtnetlink.c:3885 [inline] rtnl_newlink+0x1704/0x1d30 net/core/rtnetlink.c:4022 page last free pid 5898 tgid 5898 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe0d/0x10e0 mm/page_alloc.c:2660 vfree+0x1c3/0x360 mm/vmalloc.c:3383 kcov_put kernel/kcov.c:439 [inline] kcov_close+0x28/0x50 kernel/kcov.c:535 __fput+0x3e9/0x9f0 fs/file_table.c:464 task_work_run+0x24f/0x310 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xa2a/0x28e0 kernel/exit.c:938 do_group_exit+0x207/0x2c0 kernel/exit.c:1087 get_signal+0x168c/0x1720 kernel/signal.c:3036 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [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+0xce/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805bb96800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805bb96880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805bb96900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805bb96980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805bb96a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================