================================================================== 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+0x1b76/0x5ec0 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705 Write of size 1440 at addr ffffc9000c5afda0 by task vivid-000-vid-c/27138 CPU: 0 UID: 0 PID: 27138 Comm: vivid-000-vid-c Not tainted 6.15.0-rc6-syzkaller-00052-g9f35e33144ae #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x29a/0x2b0 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+0x1b76/0x5ec0 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+0xfff/0x5fe0 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:629 vivid_thread_vid_cap+0x8d8/0x10d0 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:767 kthread+0x711/0x8a0 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 [ffffc9000c599000, ffffc9000c5b1000) created by: vb2_vmalloc_alloc+0xef/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:0xf1 pfn:0x315e8 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 00000000000000f1 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 27137, tgid 27136 (syz.4.5301), ts 1405724690909, free_ts 1404101506685 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21ce/0x22b0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_frozen_pages_noprof mm/mempolicy.c:2372 [inline] alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2392 vm_area_alloc_pages mm/vmalloc.c:3592 [inline] __vmalloc_area_node mm/vmalloc.c:3670 [inline] __vmalloc_node_range_noprof+0x8fe/0x12c0 mm/vmalloc.c:3845 vmalloc_user_noprof+0x74/0x80 mm/vmalloc.c:3997 vb2_vmalloc_alloc+0xef/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+0x9c2/0x15a0 drivers/media/common/videobuf2/videobuf2-core.c:523 vb2_core_reqbufs+0xc31/0x1420 drivers/media/common/videobuf2/videobuf2-core.c:964 __vb2_init_fileio+0x318/0xff0 drivers/media/common/videobuf2/videobuf2-core.c:2895 vb2_core_poll+0x4c1/0x840 drivers/media/common/videobuf2/videobuf2-core.c:2729 vb2_poll drivers/media/common/videobuf2/videobuf2-v4l2.c:980 [inline] vb2_fop_poll+0x168/0x380 drivers/media/common/videobuf2/videobuf2-v4l2.c:1245 v4l2_poll+0x144/0x2c0 drivers/media/v4l2-core/v4l2-dev.c:350 vfs_poll include/linux/poll.h:82 [inline] do_pollfd fs/select.c:870 [inline] do_poll fs/select.c:913 [inline] do_sys_poll+0x8be/0x1050 fs/select.c:1009 __do_sys_ppoll fs/select.c:1115 [inline] __se_sys_ppoll+0x1ff/0x260 fs/select.c:1095 page last free pid 27107 tgid 27106 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] free_unref_folios+0xb81/0x14a0 mm/page_alloc.c:2782 folios_put_refs+0x559/0x640 mm/swap.c:992 folio_batch_release include/linux/pagevec.h:101 [inline] invalidate_inode_pages2_range+0x889/0xa80 mm/truncate.c:703 blkdev_direct_write+0x48/0x140 block/fops.c:670 blkdev_write_iter+0x544/0x710 block/fops.c:744 iter_file_splice_write+0x937/0x1000 fs/splice.c:738 do_splice_from fs/splice.c:935 [inline] direct_splice_actor+0x101/0x160 fs/splice.c:1158 splice_direct_to_actor+0x5a5/0xcc0 fs/splice.c:1102 do_splice_direct_actor fs/splice.c:1201 [inline] do_splice_direct+0x181/0x270 fs/splice.c:1227 do_sendfile+0x4da/0x7d0 fs/read_write.c:1368 __do_sys_sendfile64 fs/read_write.c:1429 [inline] __se_sys_sendfile64+0x13e/0x190 fs/read_write.c:1415 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc9000c5aff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000c5aff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9000c5b0000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ^ ffffc9000c5b0080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ffffc9000c5b0100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ==================================================================