================================================================== BUG: KASAN: use-after-free in memcpy_from_iter lib/iov_iter.c:73 [inline] BUG: KASAN: use-after-free in iterate_bvec include/linux/iov_iter.h:122 [inline] BUG: KASAN: use-after-free in iterate_and_advance2 include/linux/iov_iter.h:249 [inline] BUG: KASAN: use-after-free in iterate_and_advance include/linux/iov_iter.h:271 [inline] BUG: KASAN: use-after-free in __copy_from_iter lib/iov_iter.c:268 [inline] BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0x9b8/0x1e80 lib/iov_iter.c:500 Read of size 4096 at addr ffff888022838000 by task kworker/u4:6/2431 CPU: 0 PID: 2431 Comm: kworker/u4:6 Not tainted 6.8.0-rc4-syzkaller-00267-g0f1dd5e91e2b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Workqueue: loop2 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x167/0x540 mm/kasan/report.c:488 kasan_report+0x142/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 memcpy_from_iter lib/iov_iter.c:73 [inline] iterate_bvec include/linux/iov_iter.h:122 [inline] iterate_and_advance2 include/linux/iov_iter.h:249 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] __copy_from_iter lib/iov_iter.c:268 [inline] copy_page_from_iter_atomic+0x9b8/0x1e80 lib/iov_iter.c:500 generic_perform_write+0x39a/0x640 mm/filemap.c:3938 shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2893 do_iter_readv_writev+0x46e/0x640 vfs_iter_write+0x244/0x5d0 fs/read_write.c:895 lo_write_bvec drivers/block/loop.c:246 [inline] lo_write_simple drivers/block/loop.c:267 [inline] do_req_filebacked drivers/block/loop.c:491 [inline] loop_handle_cmd drivers/block/loop.c:1909 [inline] loop_process_work+0x13a2/0x1e60 drivers/block/loop.c:1944 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x915/0x1420 kernel/workqueue.c:2706 worker_thread+0xa5f/0x1000 kernel/workqueue.c:2787 kthread+0x2f1/0x390 kernel/kthread.c:388 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:242 The buggy address belongs to the physical page: page:ffffea00008a0e00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22838 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 ffffea00008e0dc8 ffffea0001e69b08 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x100dc0(GFP_USER|__GFP_ZERO), pid 13405, tgid 13403 (syz-executor.2), ts 382114372580, free_ts 382767839280 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311 __alloc_pages+0x255/0x680 mm/page_alloc.c:4567 alloc_pages_mpol+0x3de/0x650 mm/mempolicy.c:2133 lbmLogInit fs/jfs/jfs_logmgr.c:1816 [inline] lmLogInit+0x37a/0x1c90 fs/jfs/jfs_logmgr.c:1270 open_inline_log fs/jfs/jfs_logmgr.c:1175 [inline] lmLogOpen+0x573/0x1050 fs/jfs/jfs_logmgr.c:1069 jfs_mount_rw+0xf1/0x6a0 fs/jfs/jfs_mount.c:257 jfs_fill_super+0x681/0xc50 fs/jfs/super.c:565 mount_bdev+0x20c/0x2d0 fs/super.c:1663 legacy_get_tree+0xf0/0x190 fs/fs_context.c:662 vfs_get_tree+0x92/0x2a0 fs/super.c:1784 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6f/0x77 page last free pid 5120 tgid 5120 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x968/0xa90 mm/page_alloc.c:2346 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486 lbmLogShutdown fs/jfs/jfs_logmgr.c:1864 [inline] lmLogShutdown+0x4fc/0x970 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x297/0x530 fs/jfs/jfs_logmgr.c:1460 jfs_umount+0x2ce/0x3a0 fs/jfs/jfs_umount.c:114 jfs_put_super+0x8a/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x138/0x2d0 fs/super.c:646 kill_block_super+0x44/0x90 fs/super.c:1680 deactivate_locked_super+0xc6/0x130 fs/super.c:477 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1267 task_work_run+0x250/0x310 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:108 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0x167/0x370 kernel/entry/common.c:212 do_syscall_64+0x108/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x6f/0x77 Memory state around the buggy address: ffff888022837f00: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff888022837f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888022838000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888022838080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888022838100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================