================================================================== BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0xf6f/0x1730 lib/iov_iter.c:817 Read of size 4096 at addr ffff888082c50000 by task kworker/u4:0/19730 CPU: 0 PID: 19730 Comm: kworker/u4:0 Not tainted 6.0.0-rc6-syzkaller-00286-ga63f2e7cb110 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: loop1 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x20/0x60 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0xf6f/0x1730 lib/iov_iter.c:817 generic_perform_write+0x2ba/0x560 mm/filemap.c:3746 __generic_file_write_iter+0x2aa/0x4d0 mm/filemap.c:3866 generic_file_write_iter+0xdf/0x350 mm/filemap.c:3898 call_write_iter include/linux/fs.h:2187 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:729 do_iter_write+0x182/0x700 fs/read_write.c:855 vfs_iter_write+0x70/0xa0 fs/read_write.c:896 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:1864 [inline] loop_process_work+0xd83/0x2050 drivers/block/loop.c:1899 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the physical page: page:ffffea00020b1400 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x82c50 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0002033248 ffffea00020c72c8 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 8101, tgid 8100 (syz-executor.1), ts 1229084608617, free_ts 1229191551023 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 lbmLogInit fs/jfs/jfs_logmgr.c:1816 [inline] lmLogInit+0x358/0x17a0 fs/jfs/jfs_logmgr.c:1270 open_inline_log fs/jfs/jfs_logmgr.c:1175 [inline] lmLogOpen+0x7c8/0x13e0 fs/jfs/jfs_logmgr.c:1069 jfs_mount_rw+0x321/0x5d0 fs/jfs/jfs_mount.c:253 jfs_fill_super+0x9bc/0xc70 fs/jfs/super.c:565 mount_bdev+0x34d/0x410 fs/super.c:1400 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1326/0x1e20 fs/namespace.c:3370 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+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 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:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 lbmLogShutdown fs/jfs/jfs_logmgr.c:1864 [inline] lmLogShutdown+0x33d/0x600 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x55b/0x6f0 fs/jfs/jfs_logmgr.c:1460 jfs_umount+0x2d3/0x3f0 fs/jfs/jfs_umount.c:116 jfs_fill_super+0xa47/0xc70 fs/jfs/super.c:600 mount_bdev+0x34d/0x410 fs/super.c:1400 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1530 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1326/0x1e20 fs/namespace.c:3370 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+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888082c4ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff888082c4ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888082c50000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888082c50080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888082c50100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================