================================================================== BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0xb99/0x1560 lib/iov_iter.c:969 Read of size 4096 at addr ffff88806edff000 by task kworker/u4:3/57 CPU: 1 PID: 57 Comm: kworker/u4:3 Not tainted 5.19.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Workqueue: loop3 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x5b/0x81 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:189 memcpy+0x24/0x60 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0xb99/0x1560 lib/iov_iter.c:969 generic_perform_write+0x263/0x490 mm/filemap.c:3777 __generic_file_write_iter+0x212/0x400 mm/filemap.c:3897 generic_file_write_iter+0xbd/0x1d0 mm/filemap.c:3929 call_write_iter include/linux/fs.h:2058 [inline] do_iter_readv_writev+0x2b4/0x5b0 fs/read_write.c:742 do_iter_write+0x124/0x620 fs/read_write.c:868 lo_write_bvec drivers/block/loop.c:249 [inline] lo_write_simple drivers/block/loop.c:271 [inline] do_req_filebacked drivers/block/loop.c:495 [inline] loop_handle_cmd drivers/block/loop.c:1859 [inline] loop_process_work+0xb76/0x1bb0 drivers/block/loop.c:1894 process_one_work+0x865/0x13d0 kernel/workqueue.c:2289 worker_thread+0x59c/0xec0 kernel/workqueue.c:2436 kthread+0x29d/0x340 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 The buggy address belongs to the physical page: page:ffffea0001bb7fc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6edff flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001d21808 ffffea00007a0d48 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 7585, tgid 7584 (syz-executor.3), ts 207866408174, free_ts 207868192775 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198 __alloc_pages+0x1cb/0x520 mm/page_alloc.c:5426 lbmLogInit fs/jfs/jfs_logmgr.c:1816 [inline] lmLogInit+0x32d/0x1590 fs/jfs/jfs_logmgr.c:1270 open_inline_log fs/jfs/jfs_logmgr.c:1175 [inline] lmLogOpen+0x6d0/0x1170 fs/jfs/jfs_logmgr.c:1069 jfs_mount_rw+0x2b9/0x530 fs/jfs/jfs_mount.c:253 jfs_remount+0x450/0x5a0 fs/jfs/super.c:454 reconfigure_super+0x24c/0x8e0 fs/super.c:905 vfs_fsconfig_locked fs/fsopen.c:254 [inline] __do_sys_fsconfig+0x76a/0x970 fs/fsopen.c:439 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x1d/0x6a0 mm/page_alloc.c:3438 lbmLogShutdown fs/jfs/jfs_logmgr.c:1864 [inline] lmLogShutdown+0x303/0x590 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x4af/0x680 fs/jfs/jfs_logmgr.c:1460 jfs_remount+0x346/0x5a0 fs/jfs/super.c:466 reconfigure_super+0x24c/0x8e0 fs/super.c:905 do_remount fs/namespace.c:2702 [inline] path_mount+0x13aa/0x1a40 fs/namespace.c:3362 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x1f9/0x270 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Memory state around the buggy address: ffff88806edfef00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff88806edfef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88806edff000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806edff080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806edff100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================