================================================================== 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:249 [inline] BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0x951/0x1aa0 lib/iov_iter.c:481 Read of size 4096 at addr ffff888079025000 by task kworker/u8:5/994 CPU: 0 PID: 994 Comm: kworker/u8:5 Not tainted 6.9.0-rc5-next-20240426-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: loop0 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/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:249 [inline] copy_page_from_iter_atomic+0x951/0x1aa0 lib/iov_iter.c:481 generic_perform_write+0x39b/0x640 mm/filemap.c:4024 shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2919 do_iter_readv_writev+0x5a4/0x800 vfs_iter_write+0x244/0x610 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:1907 [inline] loop_process_work+0x13a3/0x1e60 drivers/block/loop.c:1942 process_one_work kernel/workqueue.c:3222 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3303 worker_thread+0x86d/0xd70 kernel/workqueue.c:3384 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x4 pfn:0x79025 flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) raw: 00fff80000000000 ffffea0001f1e648 ffffea0001f1e608 0000000000000000 raw: 0000000000000004 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 10969, tgid 10968 (syz-executor.0), ts 304819842211, free_ts 305331396089 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3438 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4696 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 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+0x55e/0x1040 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+0x20a/0x2d0 fs/super.c:1659 legacy_get_tree+0xee/0x190 fs/fs_context.c:662 vfs_get_tree+0x90/0x2a0 fs/super.c:1780 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_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 8917 tgid 8917 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2601 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+0x136/0x2d0 fs/super.c:642 kill_block_super+0x44/0x90 fs/super.c:1676 deactivate_locked_super+0xc4/0x130 fs/super.c:473 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1267 task_work_run+0x24f/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:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218 do_syscall_64+0x102/0x240 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888079024f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888079024f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888079025000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888079025080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888079025100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================