================================================================== BUG: KASAN: stack-out-of-bounds in iterate_bvec include/linux/iov_iter.h:116 [inline] BUG: KASAN: stack-out-of-bounds in __copy_from_iter_mc+0x30a/0x3f0 lib/iov_iter.c:262 Read of size 4 at addr ffffc90016037574 by task syz-executor.5/6509 CPU: 1 PID: 6509 Comm: syz-executor.5 Not tainted 6.6.0-rc3-next-20230929-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 iterate_bvec include/linux/iov_iter.h:116 [inline] __copy_from_iter_mc+0x30a/0x3f0 lib/iov_iter.c:262 __copy_from_iter lib/iov_iter.c:271 [inline] copy_page_from_iter_atomic+0x471/0x11e0 lib/iov_iter.c:504 generic_perform_write+0x2e9/0x600 mm/filemap.c:3964 ext4_buffered_write_iter+0x11f/0x3c0 fs/ext4/file.c:299 ext4_file_write_iter+0x7f7/0x1860 fs/ext4/file.c:717 __kernel_write_iter+0x261/0x7e0 fs/read_write.c:517 dump_emit_page fs/coredump.c:888 [inline] dump_user_range+0x299/0x790 fs/coredump.c:915 elf_core_dump+0x2700/0x3900 fs/binfmt_elf.c:2142 do_coredump+0x2c97/0x3fc0 fs/coredump.c:764 get_signal+0x2434/0x2790 kernel/signal.c:2890 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f133387b9da Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24 RSP: 002b:00007ffff13fdf60 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000003 RBX: 0000000000000004 RCX: 00007f133387b9da RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 0000000000000032 R08: 0000001b31e20000 R09: 000000000000057b R10: 000000008173cafa R11: 0000000000000293 R12: 00007f1333400150 R13: ffffffffffffffff R14: 00007f1333400000 R15: 0000000000054dd7 The buggy address belongs to stack of task syz-executor.5/6509 and is located at offset 108 in frame: dump_user_range+0x0/0x790 fs/coredump.c:482 This frame has 3 objects: [48, 56) 'pos' [80, 96) 'bvec' [112, 152) 'iter' The buggy address belongs to the virtual mapping at [ffffc90016030000, ffffc90016039000) created by: kernel_clone+0xfd/0x920 kernel/fork.c:2902 The buggy address belongs to the physical page: page:ffffea0000a37400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28dd0 memcg:ffff88802732a102 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88802732a102 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 6487, tgid 6487 (syz-executor.4), ts 347119231707, free_ts 314049268514 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x98f/0x32a0 mm/page_alloc.c:3333 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4589 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2304 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0x8f3/0x1bf0 mm/vmalloc.c:3320 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct kernel/fork.c:1118 [inline] copy_process+0x13e3/0x74b0 kernel/fork.c:2327 kernel_clone+0xfd/0x920 kernel/fork.c:2902 __do_sys_clone3+0x1f1/0x260 kernel/fork.c:3203 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1134 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2383 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2518 kasan_depopulate_vmalloc_pte+0x63/0x80 mm/kasan/shadow.c:427 apply_to_pte_range mm/memory.c:2601 [inline] apply_to_pmd_range mm/memory.c:2645 [inline] apply_to_pud_range mm/memory.c:2681 [inline] apply_to_p4d_range mm/memory.c:2717 [inline] __apply_to_page_range+0x5ed/0xdb0 mm/memory.c:2751 kasan_release_vmalloc+0xa8/0xc0 mm/kasan/shadow.c:544 __purge_vmap_area_lazy+0x8b9/0x2160 mm/vmalloc.c:1770 drain_vmap_area_work+0x54/0xd0 mm/vmalloc.c:1804 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffffc90016037400: f1 f1 f1 00 00 00 00 00 00 f3 f3 f3 f3 00 00 00 ffffc90016037480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90016037500: 00 f1 f1 f1 f1 f1 f1 00 f2 f2 f2 00 00 f2 f2 00 ^ ffffc90016037580: 00 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 ffffc90016037600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================