================================================================== BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0xaa1/0x1070 lib/iov_iter.c:820 Read of size 4096 at addr ffff88808655d000 by task kworker/u4:2/40 CPU: 0 PID: 40 Comm: kworker/u4:2 Not tainted 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Workqueue: loop1 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x461 mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x20/0x60 mm/kasan/shadow.c:65 copy_page_from_iter_atomic+0xaa1/0x1070 lib/iov_iter.c:820 generic_perform_write+0x2c6/0x570 mm/filemap.c:3761 __generic_file_write_iter+0x2aa/0x4d0 mm/filemap.c:3881 generic_file_write_iter+0xdf/0x350 mm/filemap.c:3913 call_write_iter include/linux/fs.h:2191 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_iter_write+0x70/0xa0 fs/read_write.c:902 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:1864 [inline] loop_process_work+0xd83/0x2050 drivers/block/loop.c:1899 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the physical page: page:ffffea0002195740 refcount:1 mapcount:0 mapping:ffff88801b756c78 index:0x1c pfn:0x8655d memcg:ffff888012182000 aops:def_blk_aops ino:700001 flags: 0xfff00000020016(referenced|uptodate|lru|mappedtodisk|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000020016 ffffea0002225a08 ffffea0001d07608 ffff88801b756c78 raw: 000000000000001c 0000000000000000 00000001ffffffff ffff888012182000 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 3914, tgid 3914 (udevd), ts 980264522396, free_ts 980257029774 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4287 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5554 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2285 folio_alloc+0x1c/0x70 mm/mempolicy.c:2295 filemap_alloc_folio+0x306/0x3a0 mm/filemap.c:971 page_cache_ra_unbounded+0x1aa/0x5e0 mm/readahead.c:248 do_page_cache_ra mm/readahead.c:300 [inline] force_page_cache_ra+0x32f/0x470 mm/readahead.c:331 page_cache_sync_ra+0x101/0x200 mm/readahead.c:705 page_cache_sync_readahead include/linux/pagemap.h:1213 [inline] filemap_get_pages+0x2ca/0x16b0 mm/filemap.c:2581 filemap_read+0x311/0xc00 mm/filemap.c:2675 blkdev_read_iter+0x3e7/0x750 block/fops.c:598 call_read_iter include/linux/fs.h:2185 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x67d/0x930 fs/read_write.c:470 ksys_read+0x127/0x250 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 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:1458 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3482 lbmLogShutdown fs/jfs/jfs_logmgr.c:1864 [inline] lmLogShutdown+0x33d/0x600 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x55b/0x6f0 fs/jfs/jfs_logmgr.c:1460 jfs_umount+0x2d3/0x3f0 fs/jfs/jfs_umount.c:116 jfs_put_super+0x81/0x190 fs/jfs/super.c:194 generic_shutdown_super+0x154/0x410 fs/super.c:491 kill_block_super+0x97/0xf0 fs/super.c:1427 deactivate_locked_super+0x94/0x160 fs/super.c:331 deactivate_super+0xad/0xd0 fs/super.c:362 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1186 task_work_run+0x16b/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:296 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88808655df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88808655df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88808655e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808655e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808655e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================