================================================================== BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0x8b4/0x1140 lib/iov_iter.c:817 Read of size 4096 at addr ffff8880788d8000 by task kworker/u4:6/3919 CPU: 0 PID: 3919 Comm: kworker/u4:6 Not tainted 6.0.0-rc7-syzkaller-00180-g70575e77839f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: loop2 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x1f0 mm/kasan/report.c:433 kasan_report+0xc3/0xf0 mm/kasan/report.c:495 kasan_check_range+0x2a7/0x2e0 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0x8b4/0x1140 lib/iov_iter.c:817 generic_perform_write+0x31f/0x5b0 mm/filemap.c:3746 __generic_file_write_iter+0x176/0x400 mm/filemap.c:3866 generic_file_write_iter+0xab/0x310 mm/filemap.c:3898 do_iter_write+0x6c2/0xc20 fs/read_write.c:861 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+0x149f/0x2320 drivers/block/loop.c:1899 process_one_work+0x877/0xdb0 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 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:ffffea0001e23600 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x788d8 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001ea1a08 ffffea0001d76bc8 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 15882, tgid 15881 (syz-executor.2), ts 408261110186, free_ts 408276161140 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 lbmLogInit fs/jfs/jfs_logmgr.c:1816 [inline] lmLogInit+0x30c/0x1c30 fs/jfs/jfs_logmgr.c:1270 open_inline_log fs/jfs/jfs_logmgr.c:1175 [inline] lmLogOpen+0x4fd/0x1000 fs/jfs/jfs_logmgr.c:1069 jfs_mount_rw+0xe7/0x710 fs/jfs/jfs_mount.c:253 jfs_fill_super+0x675/0xc50 fs/jfs/super.c:565 mount_bdev+0x26c/0x3a0 fs/super.c:1400 legacy_get_tree+0xea/0x180 fs/fs_context.c:610 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x289/0xad0 fs/namespace.c:3040 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x2d3/0x3c0 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/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+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x5f0 mm/page_alloc.c:3476 lbmLogShutdown fs/jfs/jfs_logmgr.c:1864 [inline] lmLogShutdown+0x4ad/0x920 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x291/0x530 fs/jfs/jfs_logmgr.c:1460 jfs_umount+0x297/0x370 fs/jfs/jfs_umount.c:116 jfs_put_super+0x86/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x128/0x300 fs/super.c:491 kill_block_super+0x79/0xd0 fs/super.c:1427 deactivate_locked_super+0xa7/0xf0 fs/super.c:332 cleanup_mnt+0x4ce/0x560 fs/namespace.c:1186 task_work_run+0x146/0x1c0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x124/0x150 kernel/entry/common.c:169 exit_to_user_mode_prepare+0xb2/0x140 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:294 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8880788d7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880788d7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880788d8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880788d8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880788d8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================