[Android 5.10] KASAN: slab-out-of-bounds Read in mon_bin_event

1 view
Skip to first unread message

syzbot

unread,
Jul 1, 2025, 2:26:32 PMJul 1
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 59e9a7228857 Merge android13-5.10 into android13-5.10-lts
git tree: android13-5.10-lts
console+strace: https://syzkaller.appspot.com/x/log.txt?x=17542ebc580000
kernel config: https://syzkaller.appspot.com/x/.config?x=65ae605fa87ade4
dashboard link: https://syzkaller.appspot.com/bug?extid=ec475ee55a9be606e53c
compiler: Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13033982580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=106e9770580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/35716a9d2c38/disk-59e9a722.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/106d562485f2/vmlinux-59e9a722.xz
kernel image: https://storage.googleapis.com/syzbot-assets/44ba14f4268d/bzImage-59e9a722.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ec475e...@syzkaller.appspotmail.com

usb 1-1: config 0 descriptor??
microsoft 0003:045E:07DA.0001: unknown main item tag 0x0
microsoft 0003:045E:07DA.0001: ignoring exceeding usage max
==================================================================
BUG: KASAN: slab-out-of-bounds in mon_copy_to_buff drivers/usb/mon/mon_bin.c:249 [inline]
BUG: KASAN: slab-out-of-bounds in mon_bin_get_data drivers/usb/mon/mon_bin.c:417 [inline]
BUG: KASAN: slab-out-of-bounds in mon_bin_event+0x1307/0x24e0 drivers/usb/mon/mon_bin.c:603
Read of size 832 at addr ffff88811cf8eed9 by task kworker/1:1/25

CPU: 1 PID: 25 Comm: kworker/1:1 Not tainted 5.10.238-syzkaller-00008-g59e9a7228857 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: usb_hub_wq hub_event
Call Trace:
__dump_stack+0x21/0x24 lib/dump_stack.c:77
dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0xe2/0x130 mm/kasan/report.c:452
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x280/0x290 mm/kasan/generic.c:189
memcpy+0x2d/0x70 mm/kasan/shadow.c:65
mon_copy_to_buff drivers/usb/mon/mon_bin.c:249 [inline]
mon_bin_get_data drivers/usb/mon/mon_bin.c:417 [inline]
mon_bin_event+0x1307/0x24e0 drivers/usb/mon/mon_bin.c:603
mon_bin_submit+0x27/0x30 drivers/usb/mon/mon_bin.c:623
mon_bus_submit drivers/usb/mon/mon_main.c:91 [inline]
mon_submit+0x185/0x200 drivers/usb/mon/mon_main.c:103
usbmon_urb_submit include/linux/usb/hcd.h:723 [inline]
usb_hcd_submit_urb+0x117/0x1780 drivers/usb/core/hcd.c:1543
usb_submit_urb+0x10eb/0x1620 drivers/usb/core/urb.c:585
usb_start_wait_urb+0x117/0x2f0 drivers/usb/core/message.c:58
usb_internal_control_msg drivers/usb/core/message.c:102 [inline]
usb_control_msg+0x241/0x3f0 drivers/usb/core/message.c:153
usbhid_set_raw_report drivers/hid/usbhid/hid-core.c:928 [inline]
usbhid_raw_request+0x453/0x580 drivers/hid/usbhid/hid-core.c:1296
__hid_request+0x1d2/0x390 drivers/hid/hid-core.c:1737
hidinput_change_resolution_multipliers drivers/hid/hid-input.c:1657 [inline]
hidinput_connect+0x1d6d/0x2c30 drivers/hid/hid-input.c:1963
hid_connect+0x458/0xdf0 drivers/hid/hid-core.c:1968
hid_hw_start+0xaa/0x130 drivers/hid/hid-core.c:2075
ms_probe+0x190/0x460 drivers/hid/hid-microsoft.c:391
hid_device_probe+0x287/0x380 drivers/hid/hid-core.c:2303
really_probe+0x386/0xa90 drivers/base/dd.c:558
driver_probe_device+0xe7/0x190 drivers/base/dd.c:752
__device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863
bus_for_each_drv+0x175/0x200 drivers/base/bus.c:433
__device_attach+0x29a/0x400 drivers/base/dd.c:932
device_initial_probe+0x1a/0x20 drivers/base/dd.c:981
bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493
device_add+0x8b4/0xbf0 drivers/base/core.c:3273
hid_add_device+0x356/0x4b0 drivers/hid/hid-core.c:2455
usbhid_probe+0xb2e/0xee0 drivers/hid/usbhid/hid-core.c:1418
usb_probe_interface+0x5ff/0xae0 drivers/usb/core/driver.c:397
really_probe+0x3d8/0xa90 drivers/base/dd.c:562
driver_probe_device+0xe7/0x190 drivers/base/dd.c:752
__device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863
bus_for_each_drv+0x175/0x200 drivers/base/bus.c:433
__device_attach+0x29a/0x400 drivers/base/dd.c:932
device_initial_probe+0x1a/0x20 drivers/base/dd.c:981
bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493
device_add+0x8b4/0xbf0 drivers/base/core.c:3273
usb_set_configuration+0x1a47/0x1f80 drivers/usb/core/message.c:2160
usb_generic_driver_probe+0x91/0x150 drivers/usb/core/generic.c:238
usb_probe_device+0x148/0x260 drivers/usb/core/driver.c:294
really_probe+0x3d8/0xa90 drivers/base/dd.c:562
driver_probe_device+0xe7/0x190 drivers/base/dd.c:752
__device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863
bus_for_each_drv+0x175/0x200 drivers/base/bus.c:433
__device_attach+0x29a/0x400 drivers/base/dd.c:932
device_initial_probe+0x1a/0x20 drivers/base/dd.c:981
bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493
device_add+0x8b4/0xbf0 drivers/base/core.c:3273
usb_new_device+0xcd1/0x1450 drivers/usb/core/hub.c:2626
hub_port_connect drivers/usb/core/hub.c:5469 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5609 [inline]
port_event drivers/usb/core/hub.c:5759 [inline]
hub_event+0x2679/0x4120 drivers/usb/core/hub.c:5841
process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
kthread+0x346/0x3d0 kernel/kthread.c:313
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

Allocated by task 25:
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:430 [inline]
____kasan_kmalloc mm/kasan/common.c:509 [inline]
__kasan_kmalloc+0xda/0x110 mm/kasan/common.c:518
kasan_kmalloc include/linux/kasan.h:254 [inline]
__kmalloc+0x1a7/0x330 mm/slub.c:4033
kmalloc include/linux/slab.h:557 [inline]
kzalloc include/linux/slab.h:664 [inline]
hid_alloc_report_buf drivers/hid/hid-core.c:1663 [inline]
__hid_request+0x9a/0x390 drivers/hid/hid-core.c:1728
hidinput_change_resolution_multipliers drivers/hid/hid-input.c:1657 [inline]
hidinput_connect+0x1d6d/0x2c30 drivers/hid/hid-input.c:1963
hid_connect+0x458/0xdf0 drivers/hid/hid-core.c:1968
hid_hw_start+0xaa/0x130 drivers/hid/hid-core.c:2075
ms_probe+0x190/0x460 drivers/hid/hid-microsoft.c:391
hid_device_probe+0x287/0x380 drivers/hid/hid-core.c:2303
really_probe+0x386/0xa90 drivers/base/dd.c:558
driver_probe_device+0xe7/0x190 drivers/base/dd.c:752
__device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863
bus_for_each_drv+0x175/0x200 drivers/base/bus.c:433
__device_attach+0x29a/0x400 drivers/base/dd.c:932
device_initial_probe+0x1a/0x20 drivers/base/dd.c:981
bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493
device_add+0x8b4/0xbf0 drivers/base/core.c:3273
hid_add_device+0x356/0x4b0 drivers/hid/hid-core.c:2455
usbhid_probe+0xb2e/0xee0 drivers/hid/usbhid/hid-core.c:1418
usb_probe_interface+0x5ff/0xae0 drivers/usb/core/driver.c:397
really_probe+0x3d8/0xa90 drivers/base/dd.c:562
driver_probe_device+0xe7/0x190 drivers/base/dd.c:752
__device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863
bus_for_each_drv+0x175/0x200 drivers/base/bus.c:433
__device_attach+0x29a/0x400 drivers/base/dd.c:932
device_initial_probe+0x1a/0x20 drivers/base/dd.c:981
bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493
device_add+0x8b4/0xbf0 drivers/base/core.c:3273
usb_set_configuration+0x1a47/0x1f80 drivers/usb/core/message.c:2160
usb_generic_driver_probe+0x91/0x150 drivers/usb/core/generic.c:238
usb_probe_device+0x148/0x260 drivers/usb/core/driver.c:294
really_probe+0x3d8/0xa90 drivers/base/dd.c:562
driver_probe_device+0xe7/0x190 drivers/base/dd.c:752
__device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863
bus_for_each_drv+0x175/0x200 drivers/base/bus.c:433
__device_attach+0x29a/0x400 drivers/base/dd.c:932
device_initial_probe+0x1a/0x20 drivers/base/dd.c:981
bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493
device_add+0x8b4/0xbf0 drivers/base/core.c:3273
usb_new_device+0xcd1/0x1450 drivers/usb/core/hub.c:2626
hub_port_connect drivers/usb/core/hub.c:5469 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5609 [inline]
port_event drivers/usb/core/hub.c:5759 [inline]
hub_event+0x2679/0x4120 drivers/usb/core/hub.c:5841
process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
kthread+0x346/0x3d0 kernel/kthread.c:313
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

The buggy address belongs to the object at ffff88811cf8eed8
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 1 bytes inside of
8-byte region [ffff88811cf8eed8, ffff88811cf8eee0)
The buggy address belongs to the page:
page:ffffea000473e380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11cf8e
flags: 0x4000000000000200(slab)
raw: 4000000000000200 dead000000000100 dead000000000122 ffff888100043c80
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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 259, ts 17051480664, free_ts 17051018871
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook mm/page_alloc.c:2456 [inline]
prep_new_page+0x179/0x180 mm/page_alloc.c:2462
get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254
__alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5357
alloc_slab_page mm/slub.c:-1 [inline]
allocate_slab mm/slub.c:1808 [inline]
new_slab+0x84/0x3f0 mm/slub.c:1869
new_slab_objects mm/slub.c:2627 [inline]
___slab_alloc+0x2a6/0x450 mm/slub.c:2791
__slab_alloc+0x63/0xa0 mm/slub.c:2831
slab_alloc_node mm/slub.c:2913 [inline]
slab_alloc mm/slub.c:2955 [inline]
__kmalloc+0x201/0x330 mm/slub.c:4029
__kmalloc_node include/linux/slab.h:418 [inline]
kmalloc_node include/linux/slab.h:575 [inline]
kvmalloc_node+0x88/0x130 mm/util.c:612
kvmalloc include/linux/mm.h:822 [inline]
kvzalloc include/linux/mm.h:830 [inline]
proc_sys_call_handler+0x3a9/0x790 fs/proc/proc_sysctl.c:573
proc_sys_read+0x1f/0x30 fs/proc/proc_sysctl.c:611
call_read_iter include/linux/fs.h:2060 [inline]
new_sync_read fs/read_write.c:415 [inline]
vfs_read+0x874/0xa10 fs/read_write.c:496
ksys_read+0x140/0x240 fs/read_write.c:634
__do_sys_read fs/read_write.c:644 [inline]
__se_sys_read fs/read_write.c:642 [inline]
__x64_sys_read+0x7b/0x90 fs/read_write.c:642
do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x61/0xcb
page last free stack trace:
reset_page_owner include/linux/page_owner.h:28 [inline]
free_pages_prepare mm/page_alloc.c:1349 [inline]
free_pcp_prepare mm/page_alloc.c:1421 [inline]
free_unref_page_prepare+0x2b7/0x2d0 mm/page_alloc.c:3336
free_unref_page mm/page_alloc.c:3391 [inline]
free_the_page mm/page_alloc.c:5416 [inline]
__free_pages+0x14b/0x380 mm/page_alloc.c:5427
free_pages+0x82/0x90 mm/page_alloc.c:5438
_pgd_free arch/x86/mm/pgtable.c:420 [inline]
pgd_free+0x187/0x1a0 arch/x86/mm/pgtable.c:476
mm_free_pgd kernel/fork.c:675 [inline]
__mmdrop+0xad/0x490 kernel/fork.c:726
mmdrop include/linux/sched/mm.h:49 [inline]
finish_task_switch+0x1e2/0x5a0 kernel/sched/core.c:3905
schedule_tail+0x18/0xc0 kernel/sched/core.c:3982
ret_from_fork+0x8/0x30 arch/x86/entry/entry_64.S:283

Memory state around the buggy address:
ffff88811cf8ed80: fc fc fc 00 fc fc fc fc fc fc fc fc fc fc fc fc
ffff88811cf8ee00: fc fc fc fc fc fc fc fa fc fc fc fc fc f


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Sep 30, 2025, 4:20:05 PM (12 days ago) Sep 30
to syzkaller-a...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 293812d1a97d02be3720b46ccb9dcd8d46644489
Author: Benjamin Tissoires <ben...@kernel.org>
Date: Thu Jul 10 14:01:34 2025 +0000

HID: core: ensure __hid_request reserves the report ID as the first byte

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14913858580000
start commit: 1154f779f3f3 Merge android13-5.10 into android13-5.10-lts
git tree: android13-5.10-lts
kernel config: https://syzkaller.appspot.com/x/.config?x=fa3d89db0377969e
dashboard link: https://syzkaller.appspot.com/bug?extid=ec475ee55a9be606e53c
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16f5fa34580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14ddaef0580000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: HID: core: ensure __hid_request reserves the report ID as the first byte

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages