================================================================== 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+0x954/0x1db0 lib/iov_iter.c:481 Read of size 4096 at addr ffff88802d70b000 by task kworker/u8:0/10 CPU: 1 PID: 10 Comm: kworker/u8:0 Not tainted 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #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+0x954/0x1db0 lib/iov_iter.c:481 generic_perform_write+0x39b/0x640 mm/filemap.c:3982 shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2920 do_iter_readv_writev+0x5a4/0x800 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:1907 [inline] loop_process_work+0x13a3/0x1e60 drivers/block/loop.c:1942 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 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:0x0 pfn:0x2d70b flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000000 ffffea00005ba088 ffffea0001396788 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 9595, tgid -1044755039 (syz-executor.0), ts 9596, free_ts 287019990158 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3410/0x35b0 mm/page_alloc.c:3317 __alloc_pages+0x256/0x6c0 mm/page_alloc.c:4575 alloc_pages_mpol+0x3e8/0x680 mm/mempolicy.c:2264 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:1658 legacy_get_tree+0xee/0x190 fs/fs_context.c:662 vfs_get_tree+0x90/0x2a0 fs/super.c:1779 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 9325 tgid 9325 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x97b/0xaa0 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 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:641 kill_block_super+0x44/0x90 fs/super.c:1675 deactivate_locked_super+0xc4/0x130 fs/super.c:472 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: ffff88802d70af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802d70af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802d70b000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802d70b080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802d70b100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================