================================================================== BUG: KASAN: use-after-free in memcpy_from_page include/linux/highmem.h:321 [inline] BUG: KASAN: use-after-free in iov_iter_copy_from_user_atomic+0x7b2/0x13d0 lib/iov_iter.c:1053 Read of size 4096 at addr ffff8880347ea000 by task loop4/13995 CPU: 1 PID: 13995 Comm: loop4 Not tainted 5.13.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x202/0x31e lib/dump_stack.c:120 print_address_description+0x5f/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x15c/0x200 mm/kasan/report.c:436 check_region_inline mm/kasan/generic.c:135 [inline] kasan_check_range+0x2b5/0x2f0 mm/kasan/generic.c:186 memcpy+0x25/0x60 mm/kasan/shadow.c:65 memcpy_from_page include/linux/highmem.h:321 [inline] iov_iter_copy_from_user_atomic+0x7b2/0x13d0 lib/iov_iter.c:1053 generic_perform_write+0x303/0x540 mm/filemap.c:3668 __generic_file_write_iter+0x225/0x5a0 mm/filemap.c:3789 generic_file_write_iter+0xa7/0x1b0 mm/filemap.c:3821 do_iter_readv_writev+0x566/0x770 include/linux/fs.h:2108 do_iter_write+0x16c/0x5f0 fs/read_write.c:866 lo_write_bvec+0x2b7/0x6d0 drivers/block/loop.c:285 lo_write_simple drivers/block/loop.c:307 [inline] do_req_filebacked drivers/block/loop.c:630 [inline] loop_handle_cmd drivers/block/loop.c:2035 [inline] loop_queue_work+0x1e8d/0x2350 drivers/block/loop.c:2053 kthread_worker_fn+0x4e1/0x800 kernel/kthread.c:756 kthread+0x39a/0x3c0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the page: page:ffffea0000d1fa80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x347ea flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000b593c8 ffffea00004fe588 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 13992, ts 990017569718, free_ts 990084353442 prep_new_page mm/page_alloc.c:2358 [inline] get_page_from_freelist+0x779/0xa20 mm/page_alloc.c:3994 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5200 lbmLogInit fs/jfs/jfs_logmgr.c:1823 [inline] lmLogInit+0x2fc/0x1ea0 fs/jfs/jfs_logmgr.c:1278 open_inline_log fs/jfs/jfs_logmgr.c:1183 [inline] lmLogOpen+0x505/0x1190 fs/jfs/jfs_logmgr.c:1077 jfs_mount_rw+0xe7/0x710 fs/jfs/jfs_mount.c:260 jfs_fill_super+0x64c/0xc20 fs/jfs/super.c:570 mount_bdev+0x26c/0x3a0 fs/super.c:1368 legacy_get_tree+0xea/0x180 fs/fs_context.c:592 vfs_get_tree+0x86/0x270 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x196f/0x2be0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount+0x2f9/0x3b0 fs/namespace.c:3433 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 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:1298 [inline] free_pcp_prepare+0x3ea/0x420 mm/page_alloc.c:1342 free_unref_page_prepare mm/page_alloc.c:3250 [inline] free_unref_page+0x7b/0x280 mm/page_alloc.c:3298 lbmLogShutdown fs/jfs/jfs_logmgr.c:1871 [inline] lmLogShutdown+0x4ad/0x920 fs/jfs/jfs_logmgr.c:1691 lmLogClose+0x2c2/0x560 fs/jfs/jfs_logmgr.c:1467 jfs_umount+0x297/0x370 fs/jfs/jfs_umount.c:116 jfs_put_super+0x86/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x12e/0x2b0 fs/super.c:465 kill_block_super+0x79/0xd0 fs/super.c:1395 deactivate_locked_super+0xa7/0xf0 fs/super.c:335 cleanup_mnt+0x462/0x510 fs/namespace.c:1136 task_work_run+0x146/0x1c0 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+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x70 kernel/entry/common.c:302 do_syscall_64+0x4b/0xb0 arch/x86/entry/common.c:57 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff8880347e9f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880347e9f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880347ea000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880347ea080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880347ea100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================