================================================================== BUG: KASAN: use-after-free in memcpy include/linux/fortify-string.h:191 [inline] 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+0x975/0x1520 lib/iov_iter.c:1053 Read of size 4096 at addr ffff888067752000 by task loop2/12573 CPU: 3 PID: 12573 Comm: loop2 Not tainted 5.13.0-rc3-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436 check_region_inline mm/kasan/generic.c:180 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186 memcpy+0x20/0x60 mm/kasan/shadow.c:65 memcpy include/linux/fortify-string.h:191 [inline] memcpy_from_page include/linux/highmem.h:321 [inline] iov_iter_copy_from_user_atomic+0x975/0x1520 lib/iov_iter.c:1053 generic_perform_write+0x277/0x4f0 mm/filemap.c:3668 __generic_file_write_iter+0x24e/0x610 mm/filemap.c:3789 generic_file_write_iter+0xd7/0x220 mm/filemap.c:3821 call_write_iter include/linux/fs.h:2114 [inline] do_iter_readv_writev+0x46f/0x740 fs/read_write.c:740 do_iter_write+0x188/0x670 fs/read_write.c:866 vfs_iter_write+0x70/0xa0 fs/read_write.c:907 lo_write_bvec+0x141/0x6c0 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:2046 [inline] loop_queue_work+0xb70/0x1f40 drivers/block/loop.c:2064 kthread_worker_fn+0x322/0xcf0 kernel/kthread.c:756 kthread+0x3b1/0x4a0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the page: page:ffffea00019dd480 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x67752 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea00011f75c8 ffffea0001de6588 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 12570, ts 346440335251, free_ts 346671652631 prep_new_page mm/page_alloc.c:2358 [inline] get_page_from_freelist+0x1033/0x2b60 mm/page_alloc.c:3994 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5200 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2272 lbmLogInit fs/jfs/jfs_logmgr.c:1823 [inline] lmLogInit+0x358/0x1790 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:260 jfs_fill_super+0x871/0xc80 fs/jfs/super.c:570 mount_bdev+0x34d/0x410 fs/super.c:1368 legacy_get_tree+0x105/0x220 fs/fs_context.c:592 vfs_get_tree+0x89/0x2f0 fs/super.c:1498 do_new_mount fs/namespace.c:2905 [inline] path_mount+0x132a/0x1fa0 fs/namespace.c:3235 do_mount fs/namespace.c:3248 [inline] __do_sys_mount fs/namespace.c:3456 [inline] __se_sys_mount fs/namespace.c:3433 [inline] __ia32_sys_mount+0x27e/0x300 fs/namespace.c:3433 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x67/0xe0 arch/x86/entry/common.c:143 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:168 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c 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+0x223/0x300 mm/page_alloc.c:1342 free_unref_page_prepare mm/page_alloc.c:3250 [inline] free_unref_page+0x12/0x1d0 mm/page_alloc.c:3298 lbmLogShutdown fs/jfs/jfs_logmgr.c:1871 [inline] lmLogShutdown+0x33d/0x600 fs/jfs/jfs_logmgr.c:1691 lmLogClose+0x55f/0x700 fs/jfs/jfs_logmgr.c:1467 jfs_umount+0x2d3/0x3f0 fs/jfs/jfs_umount.c:116 jfs_put_super+0x81/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x14c/0x370 fs/super.c:465 kill_block_super+0x97/0xf0 fs/super.c:1395 deactivate_locked_super+0x94/0x160 fs/super.c:335 deactivate_super+0xad/0xd0 fs/super.c:366 cleanup_mnt+0x3a2/0x540 fs/namespace.c:1136 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:174 [inline] exit_to_user_mode_prepare+0x272/0x280 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 __do_fast_syscall_32+0x74/0xe0 arch/x86/entry/common.c:146 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:168 Memory state around the buggy address: ffff888067751f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888067751f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888067752000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888067752080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888067752100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================