================================================================== 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+0x1b0e/0x5d50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705 Write of size 2560 at addr ffffc90003c3c620 by task vivid-000-vid-c/13695 CPU: 0 UID: 0 PID: 13695 Comm: vivid-000-vid-c Not tainted 6.14.0-syzkaller-13189-ge48e99b6edf4 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x28f/0x2a0 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:-1 [inline] tpg_fill_plane_buffer+0x1b0e/0x5d50 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+0xfd1/0x60d0 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:629 vivid_thread_vid_cap+0x8ce/0x1120 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:767 kthread+0x7b7/0x940 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the virtual mapping at [ffffc90003c37000, ffffc90003c3e000) created by: vb2_vmalloc_alloc+0xf2/0x340 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888000000000 pfn:0x2da07 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff888000000000 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 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_ZERO|__GFP_NOWARN), pid 13694, tgid 13669 (syz.2.2246), ts 536409880090, free_ts 536128970537 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1717 prep_new_page mm/page_alloc.c:1725 [inline] get_page_from_freelist+0x352b/0x36c0 mm/page_alloc.c:3652 __alloc_frozen_pages_noprof+0x211/0x5b0 mm/page_alloc.c:4934 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301 alloc_frozen_pages_noprof mm/mempolicy.c:2372 [inline] alloc_pages_noprof+0x121/0x190 mm/mempolicy.c:2392 vm_area_alloc_pages mm/vmalloc.c:3591 [inline] __vmalloc_area_node mm/vmalloc.c:3669 [inline] __vmalloc_node_range_noprof+0x9cb/0x1390 mm/vmalloc.c:3844 vmalloc_user_noprof+0x74/0x80 mm/vmalloc.c:3996 vb2_vmalloc_alloc+0xf2/0x340 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47 __vb2_buf_mem_alloc drivers/media/common/videobuf2/videobuf2-core.c:242 [inline] __vb2_queue_alloc+0xa16/0x16f0 drivers/media/common/videobuf2/videobuf2-core.c:523 vb2_core_reqbufs+0xd3b/0x17d0 drivers/media/common/videobuf2/videobuf2-core.c:964 __vb2_init_fileio+0x319/0xfa0 drivers/media/common/videobuf2/videobuf2-core.c:2895 __vb2_perform_fileio+0x334/0x1990 drivers/media/common/videobuf2/videobuf2-core.c:3041 vb2_fop_read+0x247/0x330 drivers/media/common/videobuf2/videobuf2-v4l2.c:1215 v4l2_read+0x1a4/0x2c0 drivers/media/v4l2-core/v4l2-dev.c:316 vfs_read+0x21f/0xb90 fs/read_write.c:568 ksys_pread64 fs/read_write.c:761 [inline] __do_sys_pread64 fs/read_write.c:769 [inline] __se_sys_pread64 fs/read_write.c:766 [inline] __x64_sys_pread64+0x1b5/0x250 fs/read_write.c:766 page last free pid 15 tgid 15 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xde8/0x10a0 mm/page_alloc.c:2680 pagetable_free include/linux/mm.h:3002 [inline] pagetable_dtor_free include/linux/mm.h:3100 [inline] __tlb_remove_table+0x36b/0x460 include/asm-generic/tlb.h:215 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x79/0xf0 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2568 [inline] rcu_core+0xaac/0x17a0 kernel/rcu/tree.c:2824 handle_softirqs+0x2d6/0x9b0 kernel/softirq.c:579 run_ksoftirqd+0xcf/0x130 kernel/softirq.c:968 smpboot_thread_fn+0x576/0xaa0 kernel/smpboot.c:164 kthread+0x7b7/0x940 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffffc90003c3cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90003c3cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90003c3d000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ^ ffffc90003c3d080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ffffc90003c3d100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ==================================================================