================================================================== BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0x8e3/0x1230 lib/iov_iter.c:978 Read of size 4096 at addr ffff88801fa90000 by task kworker/u4:2/3598 CPU: 1 PID: 3598 Comm: kworker/u4:2 Not tainted 5.15.115-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Workqueue: loop4 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189 memcpy+0x25/0x60 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0x8e3/0x1230 lib/iov_iter.c:978 generic_perform_write+0x33a/0x5b0 mm/filemap.c:3784 __generic_file_write_iter+0x243/0x4f0 mm/filemap.c:3903 generic_file_write_iter+0xa7/0x1b0 mm/filemap.c:3935 do_iter_readv_writev+0x594/0x7a0 do_iter_write+0x1ea/0x760 fs/read_write.c:855 lo_write_bvec+0x297/0x740 drivers/block/loop.c:316 lo_write_simple drivers/block/loop.c:338 [inline] do_req_filebacked drivers/block/loop.c:656 [inline] loop_handle_cmd drivers/block/loop.c:2234 [inline] loop_process_work+0x2309/0x2af0 drivers/block/loop.c:2274 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307 worker_thread+0xaca/0x1280 kernel/workqueue.c:2454 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the page: page:ffffea00007ea400 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1fa90 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00007ea448 ffffea0001b2b388 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 3687, ts 791921408714, free_ts 791543236257 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421 __page_cache_alloc+0xd4/0x4a0 mm/filemap.c:1022 page_cache_ra_unbounded+0x2b1/0x930 mm/readahead.c:216 do_page_cache_ra mm/readahead.c:269 [inline] force_page_cache_ra+0x378/0x3e0 mm/readahead.c:301 page_cache_sync_readahead include/linux/pagemap.h:833 [inline] filemap_get_pages mm/filemap.c:2551 [inline] filemap_read+0x71c/0x2980 mm/filemap.c:2634 blkdev_read_iter+0x12a/0x180 block/fops.c:560 call_read_iter include/linux/fs.h:2097 [inline] new_sync_read fs/read_write.c:404 [inline] vfs_read+0xa9f/0xe10 fs/read_write.c:485 ksys_read+0x1a2/0x2c0 fs/read_write.c:623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 lbmLogShutdown fs/jfs/jfs_logmgr.c:1872 [inline] lmLogShutdown+0x4f8/0x960 fs/jfs/jfs_logmgr.c:1692 lmLogClose+0x293/0x530 fs/jfs/jfs_logmgr.c:1468 jfs_umount+0x298/0x370 fs/jfs/jfs_umount.c:116 jfs_put_super+0x86/0x180 fs/jfs/super.c:194 generic_shutdown_super+0x136/0x2c0 fs/super.c:475 kill_block_super+0x7a/0xe0 fs/super.c:1405 deactivate_locked_super+0xa0/0x110 fs/super.c:335 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143 task_work_run+0x129/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:175 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88801fa8ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801fa8ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801fa90000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88801fa90080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801fa90100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================