input: syz0 as /devices/virtual/input/input19
==================================================================
BUG: KASAN: use-after-free in steam_send_report+0x74/0x330 drivers/hid/hid-steam.c:172
Read of size 8 at addr ffff88810a24d8d0 by task syz.2.627/2024
CPU: 1 PID: 2024 Comm: syz.2.627 Not tainted 5.15.161-syzkaller-00425-gb92c0d35d015 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106
print_address_description+0x87/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:444
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
steam_send_report+0x74/0x330 drivers/hid/hid-steam.c:172
steam_send_report_byte drivers/hid/hid-steam.c:212 [inline]
steam_set_lizard_mode drivers/hid/hid-steam.c:285 [inline]
steam_input_open+0x108/0x1a0 drivers/hid/hid-steam.c:299
input_open_device+0x1a5/0x310 drivers/input/input.c:640
evdev_open_device drivers/input/evdev.c:404 [inline]
evdev_open+0x3df/0x620 drivers/input/evdev.c:491
chrdev_open+0x4f7/0x620 fs/char_dev.c:414
do_dentry_open+0x81c/0xfd0 fs/open.c:828
vfs_open+0x73/0x80 fs/open.c:958
do_open fs/namei.c:3608 [inline]
path_openat+0x26f0/0x2f40 fs/namei.c:3742
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13f/0x830 fs/open.c:1234
do_sys_open fs/open.c:1250 [inline]
__do_sys_openat fs/open.c:1266 [inline]
__se_sys_openat fs/open.c:1261 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1261
x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fa743abf8d0
Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 19 8f 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 6c 8f 02 00 8b 44
RSP: 002b:00007fa742739b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa743abf8d0
RDX: 0000000000000000 RSI: 00007fa742739c10 RDI: 00000000ffffff9c
RBP: 00007fa742739c10 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fa743c78f80 R15: 00007fff49e07f58
Allocated by task 1181:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
__kmalloc+0x13a/0x270 mm/slub.c:4427
__kmalloc_node include/linux/slab.h:469 [inline]
kmalloc_node include/linux/slab.h:626 [inline]
kzalloc_node include/linux/slab.h:744 [inline]
qdisc_alloc+0x75/0x770 net/sched/sch_generic.c:888
qdisc_create_dflt+0x6b/0x3e0 net/sched/sch_generic.c:950
attach_one_default_qdisc net/sched/sch_generic.c:1113 [inline]
netdev_for_each_tx_queue include/linux/netdevice.h:2414 [inline]
attach_default_qdiscs net/sched/sch_generic.c:1131 [inline]
dev_activate+0x2e0/0x1140 net/sched/sch_generic.c:1190
__dev_open+0x3bf/0x4e0 net/core/dev.c:1522
__dev_change_flags+0x1db/0x6e0 net/core/dev.c:8820
dev_change_flags+0x8c/0x1a0 net/core/dev.c:8891
do_setlink+0xcd1/0x3b00 net/core/rtnetlink.c:2741
__rtnl_newlink net/core/rtnetlink.c:3429 [inline]
rtnl_newlink+0x1779/0x2050 net/core/rtnetlink.c:3549
rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5629
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2508
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5647
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1356
netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
__sys_sendto+0x564/0x720 net/socket.c:2058
__do_sys_sendto net/socket.c:2070 [inline]
__se_sys_sendto net/socket.c:2066 [inline]
__x64_sys_sendto+0xe5/0x100 net/socket.c:2066
x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 63:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
kasan_slab_free include/linux/kasan.h:193 [inline]
slab_free_hook mm/slub.c:1723 [inline]
slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749
slab_free mm/slub.c:3519 [inline]
kfree+0xc8/0x220 mm/slub.c:4579
qdisc_free net/sched/sch_generic.c:1001 [inline]
qdisc_free_cb+0xaf/0xe0 net/sched/sch_generic.c:1008
rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523
rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776
handle_softirqs+0x25e/0x5c0 kernel/softirq.c:565
__do_softirq+0xb/0xd kernel/softirq.c:603
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
__call_rcu_common kernel/rcu/tree.c:3007 [inline]
call_rcu+0x135/0x1310 kernel/rcu/tree.c:3125
qdisc_destroy+0x162/0x280 net/sched/sch_generic.c:1032
qdisc_put net/sched/sch_generic.c:1044 [inline]
dev_shutdown+0x43b/0x560 net/sched/sch_generic.c:1408
unregister_netdevice_many+0x9b2/0x17c0 net/core/dev.c:11102
default_device_exit_batch+0x38a/0x3f0 net/core/dev.c:11642
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x6ce/0xc00 net/core/net_namespace.c:599
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300
Second to last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
__kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348
kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
kvfree_call_rcu+0xb1/0x8b0 kernel/rcu/tree.c:3644
drop_sysctl_table+0x311/0x450 fs/proc/proc_sysctl.c:1682
drop_sysctl_table+0x323/0x450 fs/proc/proc_sysctl.c:1685
unregister_sysctl_table+0x7b/0x120 fs/proc/proc_sysctl.c:1720
unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:175
neigh_sysctl_unregister+0x78/0x90 net/core/neighbour.c:3732
devinet_sysctl_unregister net/ipv4/devinet.c:2643 [inline]
inetdev_destroy net/ipv4/devinet.c:325 [inline]
inetdev_event+0x7c6/0x10a0 net/ipv4/devinet.c:1599
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:2025 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2037 [inline]
call_netdevice_notifiers net/core/dev.c:2051 [inline]
unregister_netdevice_many+0xe0a/0x17c0 net/core/dev.c:11109
unregister_netdevice_queue+0x2e6/0x350 net/core/dev.c:11042
unregister_netdevice include/linux/netdevice.h:3052 [inline]
__tun_detach+0xd14/0x1510 drivers/net/tun.c:686
tun_detach drivers/net/tun.c:702 [inline]
tun_chr_close+0x92/0x140 drivers/net/tun.c:3437
__fput+0x3fe/0x910 fs/file_table.c:280
____fput+0x15/0x20 fs/file_table.c:308
task_work_run+0x129/0x190 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:181
exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:307
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
The buggy address belongs to the object at ffff88810a24d800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 208 bytes inside of
512-byte region [ffff88810a24d800, ffff88810a24da00)
The buggy address belongs to the page:
page:ffffea0004289300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a24c
head:ffffea0004289300 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, ts 2243029315, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605
prep_new_page+0x1b/0x110 mm/page_alloc.c:2611
get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485
__alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779
allocate_slab mm/slub.c:1932 [inline]
new_slab+0x9a/0x4e0 mm/slub.c:1995
___slab_alloc+0x39e/0x830 mm/slub.c:3028
__slab_alloc+0x4a/0x90 mm/slub.c:3115
slab_alloc_node mm/slub.c:3206 [inline]
slab_alloc mm/slub.c:3248 [inline]
kmem_cache_alloc_trace+0x142/0x210 mm/slub.c:3265
kmem_cache_alloc_node_trace include/linux/slab.h:491 [inline]
kmalloc_node include/linux/slab.h:621 [inline]
kzalloc_node include/linux/slab.h:744 [inline]
blkg_alloc+0x8a/0x5b0 block/blk-cgroup.c:158
blkcg_init_queue+0x29/0x200 block/blk-cgroup.c:1190
blk_alloc_queue+0x3fa/0x570 block/blk-core.c:593
blk_mq_init_queue_data block/blk-mq.c:3148 [inline]
blk_mq_init_queue+0x36/0xd0 block/blk-mq.c:3162
scsi_alloc_sdev+0x674/0xa10 drivers/scsi/scsi_scan.c:319
scsi_probe_and_add_lun+0x199/0x4320 drivers/scsi/scsi_scan.c:1156
__scsi_scan_target+0x1ed/0xe30 drivers/scsi/scsi_scan.c:1637
scsi_scan_channel drivers/scsi/scsi_scan.c:1725 [inline]
scsi_scan_host_selected+0x334/0x5f0 drivers/scsi/scsi_scan.c:1754
page_owner free stack trace missing
Memory state around the buggy address:
ffff88810a24d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88810a24d800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88810a24d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88810a24d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88810a24d980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
general protection fault, probably for non-canonical address 0xdffffc001ffff1d6: 0000 [#1] PREEMPT SMP KASAN
KASAN: probably user-memory-access in range [0x00000000ffff8eb0-0x00000000ffff8eb7]
CPU: 0 PID: 2024 Comm: syz.2.627 Tainted: G B 5.15.161-syzkaller-00425-gb92c0d35d015 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:__dev_printk+0x103/0x1b0 drivers/base/core.c:4649
Code: 03 7a 8f fe 49 c7 c6 e0 93 af 85 eb 2f e8 f5 79 8f fe eb 0c e8 ee 79 8f fe eb 05 e8 e7 79 8f fe 48 89 d8 48 c1 e8 03 4d 89 f4 <42> 80 3c 30 00 74 08 48 89 df e8 ce c0 d1 fe 4c 8b 33 49 8d 5d 70
RSP: 0018:ffffc90000bff420 EFLAGS: 00010202
RAX: 000000001ffff1d6 RBX: 00000000ffff8eb1 RCX: 0000000000040000
RDX: ffffc90000f92000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90000bff450 R08: dffffc0000000000 R09: ffffc90000bff4e0
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88810a24e118 R14: dffffc0000000000 R15: 0000000000000033
FS: 00007fa74273a6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000900 CR3: 000000011f535000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
_dev_err+0x11e/0x170 drivers/base/core.c:4691
steam_send_report+0x264/0x330 drivers/hid/hid-steam.c:174
steam_send_report_byte drivers/hid/hid-steam.c:212 [inline]
steam_set_lizard_mode drivers/hid/hid-steam.c:285 [inline]
steam_input_open+0x108/0x1a0 drivers/hid/hid-steam.c:299
input_open_device+0x1a5/0x310 drivers/input/input.c:640
evdev_open_device drivers/input/evdev.c:404 [inline]
evdev_open+0x3df/0x620 drivers/input/evdev.c:491
chrdev_open+0x4f7/0x620 fs/char_dev.c:414
do_dentry_open+0x81c/0xfd0 fs/open.c:828
vfs_open+0x73/0x80 fs/open.c:958
do_open fs/namei.c:3608 [inline]
path_openat+0x26f0/0x2f40 fs/namei.c:3742
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13f/0x830 fs/open.c:1234
do_sys_open fs/open.c:1250 [inline]
__do_sys_openat fs/open.c:1266 [inline]
__se_sys_openat fs/open.c:1261 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1261
x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fa743abf8d0
Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 19 8f 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 6c 8f 02 00 8b 44
RSP: 002b:00007fa742739b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa743abf8d0
RDX: 0000000000000000 RSI: 00007fa742739c10 RDI: 00000000ffffff9c
RBP: 00007fa742739c10 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fa743c78f80 R15: 00007fff49e07f58
Modules linked in:
---[ end trace 07914f3ccb6affb4 ]---
RIP: 0010:__dev_printk+0x103/0x1b0 drivers/base/core.c:4649
Code: 03 7a 8f fe 49 c7 c6 e0 93 af 85 eb 2f e8 f5 79 8f fe eb 0c e8 ee 79 8f fe eb 05 e8 e7 79 8f fe 48 89 d8 48 c1 e8 03 4d 89 f4 <42> 80 3c 30 00 74 08 48 89 df e8 ce c0 d1 fe 4c 8b 33 49 8d 5d 70
RSP: 0018:ffffc90000bff420 EFLAGS: 00010202
RAX: 000000001ffff1d6 RBX: 00000000ffff8eb1 RCX: 0000000000040000
RDX: ffffc90000f92000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90000bff450 R08: dffffc0000000000 R09: ffffc90000bff4e0
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88810a24e118 R14: dffffc0000000000 R15: 0000000000000033
FS: 00007fa74273a6c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2df1dff8 CR3: 000000011f535000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 4 bytes skipped:
0: 49 c7 c6 e0 93 af 85 mov $0xffffffff85af93e0,%r14
7: eb 2f jmp 0x38
9: e8 f5 79 8f fe call 0xfe8f7a03
e: eb 0c jmp 0x1c
10: e8 ee 79 8f fe call 0xfe8f7a03
15: eb 05 jmp 0x1c
17: e8 e7 79 8f fe call 0xfe8f7a03
1c: 48 89 d8 mov %rbx,%rax
1f: 48 c1 e8 03 shr $0x3,%rax
23: 4d 89 f4 mov %r14,%r12
* 26: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) <-- trapping instruction
2b: 74 08 je 0x35
2d: 48 89 df mov %rbx,%rdi
30: e8 ce c0 d1 fe call 0xfed1c103
35: 4c 8b 33 mov (%rbx),%r14
38: 49 8d 5d 70 lea 0x70(%r13),%rbx