================================================================== BUG: KASAN: use-after-free in memcpy_from_iter lib/iov_iter.c:73 [inline] BUG: KASAN: use-after-free in iterate_bvec include/linux/iov_iter.h:122 [inline] BUG: KASAN: use-after-free in iterate_and_advance2 include/linux/iov_iter.h:249 [inline] BUG: KASAN: use-after-free in iterate_and_advance include/linux/iov_iter.h:271 [inline] BUG: KASAN: use-after-free in __copy_from_iter lib/iov_iter.c:249 [inline] BUG: KASAN: use-after-free in copy_page_from_iter_atomic+0x8bc/0x1170 lib/iov_iter.c:481 Read of size 4096 at addr ffff88807a2f1000 by task kworker/u8:8/1067 CPU: 1 UID: 0 PID: 1067 Comm: kworker/u8:8 Not tainted 6.11.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: loop2 loop_workfn Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 __asan_memcpy+0x23/0x60 mm/kasan/shadow.c:105 memcpy_from_iter lib/iov_iter.c:73 [inline] iterate_bvec include/linux/iov_iter.h:122 [inline] iterate_and_advance2 include/linux/iov_iter.h:249 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] __copy_from_iter lib/iov_iter.c:249 [inline] copy_page_from_iter_atomic+0x8bc/0x1170 lib/iov_iter.c:481 copy_folio_from_iter_atomic include/linux/uio.h:186 [inline] generic_perform_write+0x53d/0xaa0 mm/filemap.c:4032 shmem_file_write_iter+0x114/0x140 mm/shmem.c:3074 do_iter_readv_writev+0x534/0x800 fs/read_write.c:741 vfs_iter_write+0x1eb/0x9c0 fs/read_write.c:895 lo_write_bvec drivers/block/loop.c:243 [inline] lo_write_simple drivers/block/loop.c:264 [inline] do_req_filebacked drivers/block/loop.c:511 [inline] loop_handle_cmd drivers/block/loop.c:1910 [inline] loop_process_work+0x14dd/0x2000 drivers/block/loop.c:1945 process_one_work+0x9c8/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88807a2f1dc0 pfn:0x7a2f1 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00007ac3c8 ffffea00016b6bc8 0000000000000000 raw: ffff88807a2f1dc0 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 0x100dc0(GFP_USER|__GFP_ZERO), pid 5638, tgid 5637 (syz.2.114), ts 146633035926, free_ts 147545935761 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3439 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4695 alloc_pages_mpol_noprof+0x275/0x610 mm/mempolicy.c:2263 lbmLogInit fs/jfs/jfs_logmgr.c:1816 [inline] lmLogInit+0x4e3/0x1a90 fs/jfs/jfs_logmgr.c:1270 open_inline_log fs/jfs/jfs_logmgr.c:1175 [inline] lmLogOpen+0x7e1/0x1400 fs/jfs/jfs_logmgr.c:1069 jfs_mount_rw+0x2ea/0x700 fs/jfs/jfs_mount.c:257 jfs_fill_super+0x9d6/0xd20 fs/jfs/super.c:565 mount_bdev+0x1e6/0x2d0 fs/super.c:1679 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1800 do_new_mount fs/namespace.c:3472 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3799 do_mount fs/namespace.c:3812 [inline] __do_sys_mount fs/namespace.c:4020 [inline] __se_sys_mount fs/namespace.c:3997 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:3997 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5224 tgid 5224 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612 lbmLogShutdown fs/jfs/jfs_logmgr.c:1864 [inline] lmLogShutdown+0x371/0x780 fs/jfs/jfs_logmgr.c:1684 lmLogClose+0x57b/0x710 fs/jfs/jfs_logmgr.c:1460 jfs_umount+0x2f0/0x440 fs/jfs/jfs_umount.c:114 jfs_put_super+0x88/0x1d0 fs/jfs/super.c:194 generic_shutdown_super+0x15c/0x3d0 fs/super.c:642 kill_block_super+0x3b/0x90 fs/super.c:1696 deactivate_locked_super+0xc1/0x1a0 fs/super.c:473 deactivate_super+0xde/0x100 fs/super.c:506 cleanup_mnt+0x222/0x450 fs/namespace.c:1373 task_work_run+0x151/0x250 kernel/task_work.c:228 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807a2f0f00: fc 00 00 00 00 00 00 00 00 00 fc fc fc fc 00 00 ffff88807a2f0f80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff88807a2f1000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807a2f1080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807a2f1100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== Oops: general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] PREEMPT SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f] CPU: 1 UID: 0 PID: 1067 Comm: kworker/u8:8 Tainted: G B 6.11.0-rc5-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: loop2 loop_workfn RIP: 0010:fsnotify_parent include/linux/fsnotify.h:81 [inline] RIP: 0010:fsnotify_file include/linux/fsnotify.h:131 [inline] RIP: 0010:fsnotify_modify include/linux/fsnotify.h:388 [inline] RIP: 0010:vfs_iter_write+0x42d/0x9c0 fs/read_write.c:897 Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 4d 05 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 74 24 68 49 8d 7e 28 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 1f 05 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b RSP: 0018:ffffc900041b7a48 EFLAGS: 00010216 RAX: dffffc0000000000 RBX: ffff88807c826500 RCX: ffffffff81f8929c RDX: 0000000000000005 RSI: ffffffff81f892aa RDI: 0000000000000028 RBP: 0000000000001000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 6e696c6261736944 R12: ffff888077d66d38 R13: ffff88807c826690 R14: 0000000000000000 R15: ffff88807c826550 FS: 0000000000000000(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b3260dff8 CR3: 000000006ddca000 CR4: 0000000000350ef0 Call Trace: lo_write_bvec drivers/block/loop.c:243 [inline] lo_write_simple drivers/block/loop.c:264 [inline] do_req_filebacked drivers/block/loop.c:511 [inline] loop_handle_cmd drivers/block/loop.c:1910 [inline] loop_process_work+0x14dd/0x2000 drivers/block/loop.c:1945 process_one_work+0x9c8/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:fsnotify_parent include/linux/fsnotify.h:81 [inline] RIP: 0010:fsnotify_file include/linux/fsnotify.h:131 [inline] RIP: 0010:fsnotify_modify include/linux/fsnotify.h:388 [inline] RIP: 0010:vfs_iter_write+0x42d/0x9c0 fs/read_write.c:897 Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 4d 05 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 74 24 68 49 8d 7e 28 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 1f 05 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b RSP: 0018:ffffc900041b7a48 EFLAGS: 00010216 RAX: dffffc0000000000 RBX: ffff88807c826500 RCX: ffffffff81f8929c RDX: 0000000000000005 RSI: ffffffff81f892aa RDI: 0000000000000028 RBP: 0000000000001000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 6e696c6261736944 R12: ffff888077d66d38 R13: ffff88807c826690 R14: 0000000000000000 R15: ffff88807c826550 FS: 0000000000000000(0000) GS:ffff8880b9200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff9dea3b378 CR3: 000000001beea000 CR4: 0000000000350ef0 ---------------- Code disassembly (best guess): 0: 89 fa mov %edi,%edx 2: 48 c1 ea 03 shr $0x3,%rdx 6: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) a: 0f 85 4d 05 00 00 jne 0x55d 10: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 17: fc ff df 1a: 4d 8b 74 24 68 mov 0x68(%r12),%r14 1f: 49 8d 7e 28 lea 0x28(%r14),%rdi 23: 48 89 fa mov %rdi,%rdx 26: 48 c1 ea 03 shr $0x3,%rdx * 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction 2e: 0f 85 1f 05 00 00 jne 0x553 34: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 3b: fc ff df 3e: 4d rex.WRB 3f: 8b .byte 0x8b