================================================================== BUG: KASAN: vmalloc-out-of-bounds in tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2608 [inline] BUG: KASAN: vmalloc-out-of-bounds in tpg_fill_plane_buffer+0x2cb6/0x43c0 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705 Write of size 1440 at addr ffffc9000416fda0 by task vivid-000-vid-c/13040 CPU: 2 UID: 0 PID: 13040 Comm: vivid-000-vid-c Not tainted 6.15.0-rc1-syzkaller-00060-ga24588245776 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xe0/0x110 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 __asan_memcpy+0x3c/0x60 mm/kasan/shadow.c:106 tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2608 [inline] tpg_fill_plane_buffer+0x2cb6/0x43c0 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705 vivid_fillbuff+0x8d2/0x4250 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:470 vivid_thread_vid_cap_tick+0x814/0x15d0 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:629 vivid_thread_vid_cap+0x454/0xda0 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:767 kthread+0x3c2/0x780 kernel/kthread.c:464 ret_from_fork+0x45/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 [ffffc90004159000, ffffc90004171000) created by: vb2_vmalloc_alloc+0x135/0x3f0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802c7995a0 pfn:0x2c799 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff88802c7995a0 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 13039, tgid 13038 (syz.0.2272), ts 241091229235, free_ts 241066251112 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1717 prep_new_page mm/page_alloc.c:1725 [inline] get_page_from_freelist+0x1193/0x39b0 mm/page_alloc.c:3652 __alloc_frozen_pages_noprof+0x263/0x23a0 mm/page_alloc.c:4934 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2301 alloc_frozen_pages_noprof mm/mempolicy.c:2372 [inline] alloc_pages_noprof+0x131/0x390 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+0x732/0x1540 mm/vmalloc.c:3844 vmalloc_user_noprof+0x6b/0x90 mm/vmalloc.c:3996 vb2_vmalloc_alloc+0x135/0x3f0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47 __vb2_buf_mem_alloc drivers/media/common/videobuf2/videobuf2-core.c:242 [inline] __vb2_queue_alloc+0x8c6/0x1280 drivers/media/common/videobuf2/videobuf2-core.c:523 vb2_core_reqbufs+0xa90/0xfe0 drivers/media/common/videobuf2/videobuf2-core.c:964 __vb2_init_fileio+0x3f1/0x1100 drivers/media/common/videobuf2/videobuf2-core.c:2895 __vb2_perform_fileio+0x9c2/0x1660 drivers/media/common/videobuf2/videobuf2-core.c:3041 vb2_fop_read+0x215/0x3e0 drivers/media/common/videobuf2/videobuf2-v4l2.c:1215 v4l2_read+0x226/0x360 drivers/media/v4l2-core/v4l2-dev.c:316 vfs_read+0x1de/0xc70 fs/read_write.c:568 ksys_read+0x12a/0x240 fs/read_write.c:713 page last free pid 13039 tgid 13038 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0x69d/0xff0 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 include/asm-generic/tlb.h:215 [inline] __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x116/0x1a0 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2568 [inline] rcu_core+0x799/0x14e0 kernel/rcu/tree.c:2824 handle_softirqs+0x216/0x8e0 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Memory state around the buggy address: ffffc9000416ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000416ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90004170000: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ^ ffffc90004170080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ffffc90004170100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 ==================================================================