syzbot


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: 16d, last: 16d
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 C 7 39d 56d 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:2154
Read of size 5 at addr ffff8881433aefa0 by task fido_id/6187

CPU: 0 PID: 6187 Comm: fido_id Not tainted 6.6.101-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xac/0x220 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+0x288/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:2154
 kernfs_file_read_iter fs/kernfs/file.c:251 [inline]
 kernfs_fop_read_iter+0x3f2/0x610 fs/kernfs/file.c:280
 call_read_iter include/linux/fs.h:2012 [inline]
 new_sync_read fs/read_write.c:389 [inline]
 vfs_read+0x431/0x920 fs/read_write.c:470
 ksys_read+0x147/0x250 fs/read_write.c:613
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fd8668a7407
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:00007ffe8e6880c0 EFLAGS: 00000202 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007fd867001880 RCX: 00007fd8668a7407
RDX: 0000000000001000 RSI: 00007ffe8e688110 RDI: 0000000000000004
RBP: 0000562f4295d730 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000562f4295c930
R13: 00007ffe8e688110 R14: 0000000000000004 R15: 0000562f354bd4d8
 </TASK>

Allocated by task 5880:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:198 [inline]
 __do_kmalloc_node mm/slab_common.c:1007 [inline]
 __kmalloc_node_track_caller+0xb2/0x230 mm/slab_common.c:1027
 kmemdup+0x2b/0x70 mm/util.c:131
 kmemdup include/linux/fortify-string.h:779 [inline]
 hid_open_report+0x1bf/0xec0 drivers/hid/hid-core.c:1241
 hid_parse include/linux/hid.h:1122 [inline]
 ps_probe+0x25/0x4250 drivers/hid/hid-playstation.c:2640
 __hid_device_probe drivers/hid/hid-core.c:2644 [inline]
 hid_device_probe+0x293/0x5b0 drivers/hid/hid-core.c:2681
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x25b/0xb40 drivers/base/dd.c:658
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:800
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:830
 __device_attach_driver+0x2ca/0x520 drivers/base/dd.c:958
 bus_for_each_drv+0x24b/0x2d0 drivers/base/bus.c:459
 __device_attach+0x2b5/0x400 drivers/base/dd.c:1030
 bus_probe_device+0x180/0x260 drivers/base/bus.c:534
 device_add+0x85b/0xc20 drivers/base/core.c:3683
 hid_add_device+0x38d/0x530 drivers/hid/hid-core.c:2827
 usbhid_probe+0xe02/0x1220 drivers/hid/usbhid/hid-core.c:1432
 usb_probe_interface+0x5a4/0xb00 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x25b/0xb40 drivers/base/dd.c:658
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:800
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:830
 __device_attach_driver+0x2ca/0x520 drivers/base/dd.c:958
 bus_for_each_drv+0x24b/0x2d0 drivers/base/bus.c:459
 __device_attach+0x2b5/0x400 drivers/base/dd.c:1030
 bus_probe_device+0x180/0x260 drivers/base/bus.c:534
 device_add+0x85b/0xc20 drivers/base/core.c:3683
 usb_set_configuration+0x1a79/0x20c0 drivers/usb/core/message.c:2207
 usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x13d/0x280 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x25b/0xb40 drivers/base/dd.c:658
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:800
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:830
 __device_attach_driver+0x2ca/0x520 drivers/base/dd.c:958
 bus_for_each_drv+0x24b/0x2d0 drivers/base/bus.c:459
 __device_attach+0x2b5/0x400 drivers/base/dd.c:1030
 bus_probe_device+0x180/0x260 drivers/base/bus.c:534
 device_add+0x85b/0xc20 drivers/base/core.c:3683
 usb_new_device+0xa31/0x1630 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+0x2962/0x49c0 drivers/usb/core/hub.c:5915
 process_one_work kernel/workqueue.c:2634 [inline]
 process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
 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 5880:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:522
 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:164 [inline]
 slab_free_hook mm/slub.c:1806 [inline]
 slab_free_freelist_hook+0x130/0x1b0 mm/slub.c:1832
 slab_free mm/slub.c:3816 [inline]
 __kmem_cache_free+0xba/0x1f0 mm/slub.c:3829
 hid_close_report+0x605/0x6d0 drivers/hid/hid-core.c:688
 __hid_device_probe drivers/hid/hid-core.c:2661 [inline]
 hid_device_probe+0x3da/0x5b0 drivers/hid/hid-core.c:2681
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x25b/0xb40 drivers/base/dd.c:658
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:800
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:830
 __device_attach_driver+0x2ca/0x520 drivers/base/dd.c:958
 bus_for_each_drv+0x24b/0x2d0 drivers/base/bus.c:459
 __device_attach+0x2b5/0x400 drivers/base/dd.c:1030
 bus_probe_device+0x180/0x260 drivers/base/bus.c:534
 device_add+0x85b/0xc20 drivers/base/core.c:3683
 hid_add_device+0x38d/0x530 drivers/hid/hid-core.c:2827
 usbhid_probe+0xe02/0x1220 drivers/hid/usbhid/hid-core.c:1432
 usb_probe_interface+0x5a4/0xb00 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x25b/0xb40 drivers/base/dd.c:658
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:800
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:830
 __device_attach_driver+0x2ca/0x520 drivers/base/dd.c:958
 bus_for_each_drv+0x24b/0x2d0 drivers/base/bus.c:459
 __device_attach+0x2b5/0x400 drivers/base/dd.c:1030
 bus_probe_device+0x180/0x260 drivers/base/bus.c:534
 device_add+0x85b/0xc20 drivers/base/core.c:3683
 usb_set_configuration+0x1a79/0x20c0 drivers/usb/core/message.c:2207
 usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x13d/0x280 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x25b/0xb40 drivers/base/dd.c:658
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:800
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:830
 __device_attach_driver+0x2ca/0x520 drivers/base/dd.c:958
 bus_for_each_drv+0x24b/0x2d0 drivers/base/bus.c:459
 __device_attach+0x2b5/0x400 drivers/base/dd.c:1030
 bus_probe_device+0x180/0x260 drivers/base/bus.c:534
 device_add+0x85b/0xc20 drivers/base/core.c:3683
 usb_new_device+0xa31/0x1630 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+0x2962/0x49c0 drivers/usb/core/hub.c:5915
 process_one_work kernel/workqueue.c:2634 [inline]
 process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
 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 ffff8881433aefa0
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
 freed 8-byte region [ffff8881433aefa0, ffff8881433aefa8)

The buggy address belongs to the physical page:
page:ffffea00050ceb80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1433ae
flags: 0x57ff00000000800(slab|node=1|zone=2|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 057ff00000000800 ffff888017841280 ffffea0005209a80 dead000000000002
raw: 0000000000000000 0000000080660066 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 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 13342300720, free_ts 0
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
 prep_new_page mm/page_alloc.c:1561 [inline]
 get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191
 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457
 alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2120
 alloc_slab_page+0x5d/0x170 mm/slub.c:1876
 allocate_slab mm/slub.c:2023 [inline]
 new_slab+0x87/0x2e0 mm/slub.c:2076
 ___slab_alloc+0xc6d/0x12f0 mm/slub.c:3230
 __slab_alloc mm/slub.c:3329 [inline]
 __slab_alloc_node mm/slub.c:3382 [inline]
 slab_alloc_node mm/slub.c:3475 [inline]
 __kmem_cache_alloc_node+0x1a2/0x260 mm/slub.c:3524
 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098
 kmalloc include/linux/slab.h:600 [inline]
 usb_control_msg+0x74/0x3e0 drivers/usb/core/message.c:144
 usb_get_status+0xe7/0x2a0 drivers/usb/core/message.c:1149
 usb_get_std_status include/linux/usb.h:1872 [inline]
 hub_configure drivers/usb/core/hub.c:1625 [inline]
 hub_probe+0x1e2f/0x37e0 drivers/usb/core/hub.c:1975
 usb_probe_interface+0x5a4/0xb00 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x25b/0xb40 drivers/base/dd.c:658
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:800
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:830
page_owner free stack trace missing

Memory state around the buggy address:
 ffff8881433aee80: fc fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc
 ffff8881433aef00: fa fc fc fc fc fa fc fc fc fc fa fc fc fc fc fa
>ffff8881433aef80: fc fc fc fc fa fc fc fc fc 07 fc fc fc fc fc fc
                               ^
 ffff8881433af000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881433af080: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc 00
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
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.