syzbot


KASAN: vmalloc-out-of-bounds Write in tpg_fill_plane_buffer

Status: upstream: reported on 2025/05/09 16:36
Reported-by: syzbot+17848f25a515137f1596@syzkaller.appspotmail.com
First crash: 10h27m, last: 10h27m
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: vmalloc-out-of-bounds Write in tpg_fill_plane_buffer (3) media C 158 3h50m 296d 0/28 upstream: reported C repro on 2024/07/17 09:01
upstream KASAN: vmalloc-out-of-bounds Write in tpg_fill_plane_buffer media 1 1938d 1938d 0/28 auto-closed as invalid on 2020/05/17 19:44
linux-5.15 KASAN: vmalloc-out-of-bounds Write in tpg_fill_plane_buffer 1 751d 751d 0/3 auto-obsoleted due to no activity on 2023/08/17 04:37
upstream KASAN: vmalloc-out-of-bounds Write in tpg_fill_plane_buffer (2) media C inconclusive done 14 830d 1342d 22/28 fixed on 2023/02/24 13:51
linux-4.19 BUG: unable to handle kernel paging request in tpg_fill_plane_buffer (2) syz error 8 876d 1377d 0/1 upstream: reported syz repro on 2021/08/02 00:51
linux-4.14 BUG: unable to handle kernel paging request in tpg_fill_plane_buffer (2) 1 1210d 1210d 0/1 auto-closed as invalid on 2022/05/15 07:48
upstream BUG: unable to handle kernel paging request in tpg_fill_plane_buffer (2) media 1 760d 756d 0/28 auto-obsoleted due to no activity on 2023/07/09 12:46

Sample crash report:
==================================================================
BUG: KASAN: vmalloc-out-of-bounds in tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:-1 [inline]
BUG: KASAN: vmalloc-out-of-bounds in tpg_fill_plane_buffer+0x1b0a/0x5e00 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705
Write of size 1440 at addr ffffc90003c9fda0 by task vivid-000-vid-c/14707

CPU: 1 PID: 14707 Comm: vivid-000-vid-c Not tainted 6.1.138-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x220 mm/kasan/report.c:427
 kasan_report+0x10b/0x140 mm/kasan/report.c:531
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x27b/0x290 mm/kasan/generic.c:189
 memcpy+0x3c/0x60 mm/kasan/shadow.c:66
 tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:-1 [inline]
 tpg_fill_plane_buffer+0x1b0a/0x5e00 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705
 vivid_fillbuff drivers/media/test-drivers/vivid/vivid-kthread-cap.c:470 [inline]
 vivid_thread_vid_cap_tick+0x1c52/0x67c0 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:729
 vivid_thread_vid_cap+0x80c/0xe50 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:872
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

The buggy address belongs to the virtual mapping at
 [ffffc90003c89000, ffffc90003ca1000) created by:
 vb2_vmalloc_alloc+0xec/0x330 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47

The buggy address belongs to the physical page:
page:ffffea00009af180 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26bc6
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 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 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 14704, tgid 14700 (syz.0.3535), ts 400691160620, free_ts 400453998366
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
 prep_new_page mm/page_alloc.c:2539 [inline]
 get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5606
 vm_area_alloc_pages mm/vmalloc.c:2994 [inline]
 __vmalloc_area_node mm/vmalloc.c:3063 [inline]
 __vmalloc_node_range+0x959/0x1390 mm/vmalloc.c:3235
 vmalloc_user+0x70/0x80 mm/vmalloc.c:3389
 vb2_vmalloc_alloc+0xec/0x330 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47
 __vb2_buf_mem_alloc drivers/media/common/videobuf2/videobuf2-core.c:233 [inline]
 __vb2_queue_alloc+0x794/0x1410 drivers/media/common/videobuf2/videobuf2-core.c:448
 vb2_core_reqbufs+0xa04/0x1110 drivers/media/common/videobuf2/videobuf2-core.c:852
 __vb2_init_fileio+0x2c4/0xc90 drivers/media/common/videobuf2/videobuf2-core.c:2680
 vb2_core_poll+0x5a9/0x7a0 drivers/media/common/videobuf2/videobuf2-core.c:2509
 vb2_poll drivers/media/common/videobuf2/videobuf2-v4l2.c:957 [inline]
 vb2_fop_poll+0x164/0x370 drivers/media/common/videobuf2/videobuf2-v4l2.c:1204
 v4l2_poll+0x13d/0x2b0 drivers/media/v4l2-core/v4l2-dev.c:348
 vfs_poll include/linux/poll.h:92 [inline]
 p9_fd_poll net/9p/trans_fd.c:238 [inline]
 p9_conn_create+0x40d/0x590 net/9p/trans_fd.c:604
 p9_fd_create+0x307/0x3e0 net/9p/trans_fd.c:1103
 p9_client_create+0x7a2/0xee0 net/9p/client.c:1008
 v9fs_session_init+0x1f2/0x17b0 fs/9p/v9fs.c:408
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1459 [inline]
 free_pcp_prepare mm/page_alloc.c:1509 [inline]
 free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
 free_unref_page_list+0xbb/0x8e0 mm/page_alloc.c:3525
 release_pages+0x1f92/0x2200 mm/swap.c:1035
 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:254 [inline]
 tlb_flush_mmu+0xff/0x210 mm/mmu_gather.c:261
 tlb_finish_mmu+0xbd/0x1c0 mm/mmu_gather.c:361
 exit_mmap+0x343/0x8e0 mm/mmap.c:3250
 __mmput+0x118/0x3c0 kernel/fork.c:1200
 exit_mm+0x1e6/0x2c0 kernel/exit.c:565
 do_exit+0x8b9/0x2400 kernel/exit.c:858
 do_group_exit+0x217/0x2d0 kernel/exit.c:1021
 get_signal+0x1272/0x1350 kernel/signal.c:2871
 arch_do_signal_or_restart+0xb0/0x1230 arch/x86/kernel/signal.c:871
 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87

Memory state around the buggy address:
 ffffc90003c9ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc90003c9ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90003ca0000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
                   ^
 ffffc90003ca0080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc90003ca0100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/09 16:35 linux-6.1.y 02b72ccb5f9d 77908e5f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: vmalloc-out-of-bounds Write in tpg_fill_plane_buffer
* Struck through repros no longer work on HEAD.