================================================================== BUG: KASAN: use-after-free in memcpy include/linux/fortify-string.h:225 [inline] BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0xd01/0x16d0 lib/iov_iter.c:969 Read of size 4096 at addr ffff888018c7c000 by task kworker/u4:6/1092 CPU: 0 PID: 1092 Comm: kworker/u4:6 Not tainted 5.16.0-rc1-next-20211118-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: loop0 loop_rootcg_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 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 memcpy include/linux/fortify-string.h:225 [inline] copy_page_from_iter_atomic+0xd01/0x16d0 lib/iov_iter.c:969 generic_perform_write+0x27a/0x510 mm/filemap.c:3764 __generic_file_write_iter+0x1c7/0x510 mm/filemap.c:3883 generic_file_write_iter+0xd7/0x220 mm/filemap.c:3915 call_write_iter include/linux/fs.h:2162 [inline] do_iter_readv_writev+0x472/0x750 fs/read_write.c:725 do_iter_write+0x188/0x710 fs/read_write.c:851 vfs_iter_write+0x70/0xa0 fs/read_write.c:892 lo_write_bvec drivers/block/loop.c:243 [inline] lo_write_simple drivers/block/loop.c:265 [inline] do_req_filebacked drivers/block/loop.c:494 [inline] loop_handle_cmd drivers/block/loop.c:1857 [inline] loop_process_work+0x128c/0x1db0 drivers/block/loop.c:1897 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the page: page:ffffea0000631f00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x18c7c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000ff9408 ffffea0001a1b4c8 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 0xdc0(GFP_KERNEL|__GFP_ZERO), pid 16654, ts 381349973558, free_ts 381579129185 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 lbmLogInit fs/jfs/jfs_logmgr.c:1824 [inline] lmLogInit+0x358/0x17a0 fs/jfs/jfs_logmgr.c:1278 open_inline_log fs/jfs/jfs_logmgr.c:1183 [inline] lmLogOpen+0x7c8/0x13e0 fs/jfs/jfs_logmgr.c:1077 jfs_mount_rw+0x321/0x5d0 fs/jfs/jfs_mount.c:253 jfs_fill_super+0x9bc/0xc70 fs/jfs/super.c:569 mount_bdev+0x34d/0x410 fs/super.c:1370 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1500 do_new_mount fs/namespace.c:2988 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3318 do_mount fs/namespace.c:3331 [inline] __do_sys_mount fs/namespace.c:3539 [inline] __se_sys_mount fs/namespace.c:3516 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3516 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+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 lbmLogShutdown fs/jfs/jfs_logmgr.c:1872 [inline] lmLogShutdown+0x33d/0x600 fs/jfs/jfs_logmgr.c:1692 lmLogClose+0x55f/0x700 fs/jfs/jfs_logmgr.c:1468 jfs_umount+0x2d3/0x3f0 fs/jfs/jfs_umount.c:116 jfs_put_super+0x81/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x14c/0x400 fs/super.c:465 kill_block_super+0x97/0xf0 fs/super.c:1397 deactivate_locked_super+0x94/0x160 fs/super.c:335 deactivate_super+0xad/0xd0 fs/super.c:366 cleanup_mnt+0x3a2/0x540 fs/namespace.c:1137 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888018c7bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888018c7bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888018c7c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888018c7c080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888018c7c100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================