================================================================== BUG: KASAN: use-after-free in memcpy_from_iter lib/iov_iter.c:380 [inline] BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0x908/0x12f0 lib/iov_iter.c:590 Read of size 4096 at addr ffff888026fa3000 by task kworker/u4:8/2815 CPU: 0 PID: 2815 Comm: kworker/u4:8 Not tainted 6.6.0-rc5-syzkaller-00157-ge8c127b05766 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Workqueue: loop5 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 memcpy_from_iter lib/iov_iter.c:380 [inline] copy_page_from_iter_atomic+0x908/0x12f0 lib/iov_iter.c:590 generic_perform_write+0x392/0x630 mm/filemap.c:3977 shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2865 do_iter_write+0x84f/0xde0 fs/read_write.c:860 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:1915 [inline] loop_process_work+0x14c3/0x22a0 drivers/block/loop.c:1950 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the physical page: page:ffffea00009be8c0 refcount:1 mapcount:0 mapping:ffff888148c90878 index:0xf pfn:0x26fa3 memcg:ffff88814125a000 aops:def_blk_aops ino:700005 flags: 0xfff00000020128(uptodate|lru|active|mappedtodisk|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000020128 ffffea00007611c8 ffffea00009bc808 ffff888148c90878 raw: 000000000000000f 0000000000000000 00000001ffffffff ffff88814125a000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5991, tgid 5991 (udevd), ts 1791562668415, free_ts 1791533517899 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 folio_alloc+0x1e/0x60 mm/mempolicy.c:2307 filemap_alloc_folio+0xde/0x500 mm/filemap.c:976 page_cache_ra_unbounded+0x1f2/0x7c0 mm/readahead.c:247 do_page_cache_ra mm/readahead.c:299 [inline] force_page_cache_ra mm/readahead.c:330 [inline] page_cache_sync_ra+0x3c9/0x480 mm/readahead.c:691 page_cache_sync_readahead include/linux/pagemap.h:1293 [inline] filemap_get_pages+0x49c/0x2080 mm/filemap.c:2556 filemap_read+0x42b/0x10b0 mm/filemap.c:2652 blkdev_read_iter+0x2df/0x430 block/fops.c:730 call_read_iter include/linux/fs.h:1950 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x795/0xb00 fs/read_write.c:470 ksys_read+0x1a0/0x2c0 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 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:1136 [inline] free_unref_page_prepare+0x8c3/0x9f0 mm/page_alloc.c:2312 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2405 lbmLogShutdown fs/jfs/jfs_logmgr.c:1864 [inline] lmLogShutdown+0x4fc/0x970 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x297/0x530 fs/jfs/jfs_logmgr.c:1460 jfs_umount+0x2ce/0x3a0 fs/jfs/jfs_umount.c:114 jfs_put_super+0x8a/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x13a/0x2c0 fs/super.c:693 kill_block_super+0x41/0x70 fs/super.c:1646 deactivate_locked_super+0xa4/0x110 fs/super.c:481 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1254 task_work_run+0x24a/0x300 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888026fa2f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888026fa2f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888026fa3000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888026fa3080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888026fa3100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================