KASAN: slab-use-after-free Read in read_report_descriptor

Status: upstream: reported on 2025/08/07 13:50
Reported-by: syzbot+c20dc89a65a25cedfb49@syzkaller.appspotmail.com
First crash: 364d, last: 44d
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-12 KASAN: slab-use-after-free Read in read_report_descriptor origin:downstream 19 syz, C 32 12d 403d 0/1 premoderation: reported C repro on 2025/06/29 07:21

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in read_report_descriptor+0xb2/0xf0 drivers/hid/hid-core.c:2177
Read of size 5 at addr ffff88802f2fec08 by task fido_id/13037

CPU: 0 PID: 13037 Comm: fido_id Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:468
 kasan_report+0x117/0x150 mm/kasan/report.c:581
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x241/0x290 mm/kasan/generic.c:187
 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105
 read_report_descriptor+0xb2/0xf0 drivers/hid/hid-core.c:2177
 kernfs_file_read_iter fs/kernfs/file.c:269 [inline]
 kernfs_fop_read_iter+0x434/0x680 fs/kernfs/file.c:298
 call_read_iter include/linux/fs.h:2012 [inline]
 new_sync_read fs/read_write.c:389 [inline]
 vfs_read+0x486/0x990 fs/read_write.c:470
 ksys_read+0x151/0x260 fs/read_write.c:613
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fae200a7407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffc12e777d0 EFLAGS: 00000202 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007fae20786880 RCX: 00007fae200a7407
RDX: 0000000000001000 RSI: 00007ffc12e77820 RDI: 0000000000000004
RBP: 000055a6a5d64730 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 000055a6a5d63930
R13: 00007ffc12e77820 R14: 0000000000000004 R15: 000055a6a553c4d8
 </TASK>

Allocated by task 42:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384
 kasan_kmalloc include/linux/kasan.h:198 [inline]
 __do_kmalloc_node mm/slab_common.c:1007 [inline]
 __kmalloc_node_track_caller+0xb4/0x230 mm/slab_common.c:1027
 kmemdup+0x2b/0x70 mm/util.c:131
 kmemdup include/linux/fortify-string.h:779 [inline]
 hid_open_report+0x1cd/0xee0 drivers/hid/hid-core.c:1241
 hid_parse include/linux/hid.h:1122 [inline]
 ccp_probe+0xc1/0x2d0 drivers/hwmon/corsair-cpro.c:521
 __hid_device_probe drivers/hid/hid-core.c:2667 [inline]
 hid_device_probe+0x290/0x5a0 drivers/hid/hid-core.c:2704
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:718
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:880
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:910
 __device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1038
 bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
 __device_attach+0x2c1/0x420 drivers/base/dd.c:1110
 bus_probe_device+0x180/0x260 drivers/base/bus.c:580
 device_add+0x87c/0xc40 drivers/base/core.c:3700
 hid_add_device+0x365/0x500 drivers/hid/hid-core.c:2850
 usbhid_probe+0xe43/0x1260 drivers/hid/usbhid/hid-core.c:1447
 usb_probe_interface+0x5c2/0xaf0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:718
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:880
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:910
 __device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1038
 bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
 __device_attach+0x2c1/0x420 drivers/base/dd.c:1110
 bus_probe_device+0x180/0x260 drivers/base/bus.c:580
 device_add+0x87c/0xc40 drivers/base/core.c:3700
 usb_set_configuration+0x1ad0/0x2150 drivers/usb/core/message.c:2265
 usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x12a/0x260 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:718
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:880
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:910
 __device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1038
 bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
 __device_attach+0x2c1/0x420 drivers/base/dd.c:1110
 bus_probe_device+0x180/0x260 drivers/base/bus.c:580
 device_add+0x87c/0xc40 drivers/base/core.c:3700
 usb_new_device+0x995/0x1550 drivers/usb/core/hub.c:2660
 hub_port_connect drivers/usb/core/hub.c:5529 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5669 [inline]
 port_event drivers/usb/core/hub.c:5833 [inline]
 hub_event+0x29d5/0x4a80 drivers/usb/core/hub.c:5915
 process_one_work kernel/workqueue.c:2653 [inline]
 process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2730
 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2811
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

Freed by task 42:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
 kasan_slab_free include/linux/kasan.h:164 [inline]
 slab_free_hook mm/slub.c:1811 [inline]
 slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
 slab_free mm/slub.c:3830 [inline]
 __kmem_cache_free+0xba/0x1f0 mm/slub.c:3843
 hid_close_report+0x605/0x6d0 drivers/hid/hid-core.c:688
 __hid_device_probe drivers/hid/hid-core.c:2684 [inline]
 hid_device_probe+0x3c7/0x5a0 drivers/hid/hid-core.c:2704
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:718
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:880
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:910
 __device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1038
 bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
 __device_attach+0x2c1/0x420 drivers/base/dd.c:1110
 bus_probe_device+0x180/0x260 drivers/base/bus.c:580
 device_add+0x87c/0xc40 drivers/base/core.c:3700
 hid_add_device+0x365/0x500 drivers/hid/hid-core.c:2850
 usbhid_probe+0xe43/0x1260 drivers/hid/usbhid/hid-core.c:1447
 usb_probe_interface+0x5c2/0xaf0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:718
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:880
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:910
 __device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1038
 bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
 __device_attach+0x2c1/0x420 drivers/base/dd.c:1110
 bus_probe_device+0x180/0x260 drivers/base/bus.c:580
 device_add+0x87c/0xc40 drivers/base/core.c:3700
 usb_set_configuration+0x1ad0/0x2150 drivers/usb/core/message.c:2265
 usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x12a/0x260 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:718
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:880
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:910
 __device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1038
 bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
 __device_attach+0x2c1/0x420 drivers/base/dd.c:1110
 bus_probe_device+0x180/0x260 drivers/base/bus.c:580
 device_add+0x87c/0xc40 drivers/base/core.c:3700
 usb_new_device+0x995/0x1550 drivers/usb/core/hub.c:2660
 hub_port_connect drivers/usb/core/hub.c:5529 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5669 [inline]
 port_event drivers/usb/core/hub.c:5833 [inline]
 hub_event+0x29d5/0x4a80 drivers/usb/core/hub.c:5915
 process_one_work kernel/workqueue.c:2653 [inline]
 process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2730
 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2811
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

The buggy address belongs to the object at ffff88802f2fec08
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
 freed 8-byte region [ffff88802f2fec08, ffff88802f2fec10)

The buggy address belongs to the physical page:
page:ffffea0000bcbf80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2f2fe
flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888017c41280 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000660066 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5773, tgid 5773 (syz-executor), ts 78597242838, free_ts 78597095335
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
 prep_new_page mm/page_alloc.c:1589 [inline]
 get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
 alloc_slab_page+0x5d/0x180 mm/slub.c:1881
 allocate_slab mm/slub.c:2028 [inline]
 new_slab+0x87/0x2d0 mm/slub.c:2081
 ___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253
 __slab_alloc mm/slub.c:3339 [inline]
 __slab_alloc_node mm/slub.c:3392 [inline]
 slab_alloc_node mm/slub.c:3485 [inline]
 __kmem_cache_alloc_node+0x11f/0x250 mm/slub.c:3534
 __do_kmalloc_node mm/slab_common.c:1006 [inline]
 __kmalloc_node+0xa6/0x240 mm/slab_common.c:1014
 kmalloc_node include/linux/slab.h:620 [inline]
 __vmalloc_area_node mm/vmalloc.c:3144 [inline]
 __vmalloc_node_range+0x598/0x1320 mm/vmalloc.c:3339
 __vmalloc_node mm/vmalloc.c:3404 [inline]
 vzalloc+0x79/0x90 mm/vmalloc.c:3477
 __do_replace+0xb4/0x9a0 net/ipv4/netfilter/ip_tables.c:1044
 do_replace net/ipv4/netfilter/ip_tables.c:1139 [inline]
 do_ipt_set_ctl+0xb38/0xe00 net/ipv4/netfilter/ip_tables.c:1632
 nf_setsockopt+0x263/0x280 net/netfilter/nf_sockopt.c:101
 do_sock_setsockopt+0x175/0x1a0 net/socket.c:2322
 __sys_setsockopt net/socket.c:2345 [inline]
 __do_sys_setsockopt net/socket.c:2354 [inline]
 __se_sys_setsockopt net/socket.c:2351 [inline]
 __x64_sys_setsockopt+0x182/0x200 net/socket.c:2351
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1182 [inline]
 free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366
 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459
 vfree+0x1a7/0x340 mm/vmalloc.c:2868
 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:864 [inline]
 get_entries net/ipv4/netfilter/ip_tables.c:1020 [inline]
 do_ipt_get_ctl+0xeef/0x1210 net/ipv4/netfilter/ip_tables.c:1665
 nf_getsockopt+0x262/0x280 net/netfilter/nf_sockopt.c:116
 ip_getsockopt+0x19f/0x230 net/ipv4/ip_sockglue.c:1790
 do_sock_getsockopt+0x379/0x450 net/socket.c:2384
 __sys_getsockopt net/socket.c:2413 [inline]
 __do_sys_getsockopt net/socket.c:2423 [inline]
 __se_sys_getsockopt net/socket.c:2420 [inline]
 __x64_sys_getsockopt+0x1d6/0x280 net/socket.c:2420
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
 ffff88802f2feb00: fc fc fc 06 fc fc fc fc 05 fc fc fc fc 05 fc fc
 ffff88802f2feb80: fc fc 00 fc fc fc fc 05 fc fc fc fc 05 fc fc fc
>ffff88802f2fec00: fc fa fc fc fc fc 05 fc fc fc fc 05 fc fc fc fc
                      ^
 ffff88802f2fec80: 05 fc fc fc fc 05 fc fc fc fc 05 fc fc fc fc 05
 ffff88802f2fed00: fc fc fc fc 00 fc fc fc fc 06 fc fc fc fc 05 fc
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/06/24 01:18 linux-6.6.y d1cfde2d5d15 042555ff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2026/06/18 06:16 linux-6.6.y 924b4a879cbb b62b3ded .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2026/06/08 21:38 linux-6.6.y 924b4a879cbb 656e94c6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2026/04/28 12:15 linux-6.6.y 142cd8382222 ce741359 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2026/03/10 03:04 linux-6.6.y 4fc00fe35d46 6972f302 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2026/02/26 13:38 linux-6.6.y 7a137e9bfa0e ffa54287 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2026/02/13 09:42 linux-6.6.y 1b4ef5214f17 6a673c50 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2025/12/27 15:21 linux-6.6.y 5fa4793a2d2d d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2025/09/20 17:38 linux-6.6.y af1544b5d072 67c37560 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
2025/08/07 13:49 linux-6.6.y 3a8ababb8b6a 04cffc22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in read_report_descriptor
* Struck through repros no longer work on HEAD.