================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:399 [inline] BUG: KASAN: use-after-free in memcpy_from_page+0x8c/0x120 lib/iov_iter.c:472 Read of size 4096 at addr ffff888013c45000 by task loop1/14993 CPU: 0 PID: 14993 Comm: loop1 Not tainted 5.10.0-rc1-next-20201028-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:192 memcpy+0x20/0x60 mm/kasan/common.c:105 memcpy include/linux/string.h:399 [inline] memcpy_from_page+0x8c/0x120 lib/iov_iter.c:472 iov_iter_copy_from_user_atomic+0x601/0xc60 lib/iov_iter.c:1005 generic_perform_write+0x277/0x4f0 mm/filemap.c:3405 __generic_file_write_iter+0x24e/0x610 mm/filemap.c:3526 generic_file_write_iter+0xd7/0x220 mm/filemap.c:3558 call_write_iter include/linux/fs.h:1886 [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/0x370 drivers/block/loop.c:287 lo_write_simple drivers/block/loop.c:309 [inline] do_req_filebacked drivers/block/loop.c:632 [inline] loop_handle_cmd drivers/block/loop.c:2048 [inline] loop_queue_work+0xb33/0x22d0 drivers/block/loop.c:2066 kthread_worker_fn+0x322/0xce0 kernel/kthread.c:710 kthread+0x3af/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 The buggy address belongs to the page: page:000000009ae6070f refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13c45 flags: 0xfff00000000000() raw: 00fff00000000000 ffffea0000463648 ffffea000044dc48 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888013c44f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888013c44f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888013c45000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888013c45080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888013c45100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================