loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: use-after-free in __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 Read of size 4 at addr ffff888059200000 by task syz.0.20/6018 CPU: 0 UID: 0 PID: 6018 Comm: syz.0.20 Not tainted 6.12.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffff88813fffc1b8 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] BUG: KASAN: use-after-free in __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 Read of size 4 at addr ffff888059200004 by task syz.0.20/6018 CPU: 0 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffff88813fffc1b8 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 Read of size 4 at addr ffff888059200010 by task syz.0.20/6018 CPU: 1 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffff88813fffc1b8 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] BUG: KASAN: use-after-free in __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 Read of size 4 at addr ffff888059200014 by task syz.0.20/6018 CPU: 0 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffff88813fffc1b8 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 Read of size 4 at addr ffff888059200020 by task syz.0.20/6018 CPU: 1 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffff88813fffc1b8 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] BUG: KASAN: use-after-free in __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 Read of size 4 at addr ffff888059200024 by task syz.0.20/6018 CPU: 0 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffffea0001560008 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 Read of size 4 at addr ffff888059200030 by task syz.0.20/6018 CPU: 1 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffffea0001560008 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] BUG: KASAN: use-after-free in __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 Read of size 4 at addr ffff888059200034 by task syz.0.20/6018 CPU: 1 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffffea0001560008 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 Read of size 4 at addr ffff888059200040 by task syz.0.20/6018 CPU: 1 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 __ocfs2_find_path+0x588/0x600 fs/ocfs2/alloc.c:1824 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffffea0001560008 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274 evict+0x40c/0x970 fs/inode.c:725 iput_final fs/inode.c:1877 [inline] iput fs/inode.c:1903 [inline] iput+0x530/0x890 fs/inode.c:1889 dentry_unlink_inode+0x29c/0x480 fs/dcache.c:412 __dentry_kill+0x1d0/0x600 fs/dcache.c:615 dput.part.0+0x4b1/0x9b0 fs/dcache.c:857 dput+0x1f/0x30 fs/dcache.c:847 __fput+0x513/0xb60 fs/file_table.c:439 task_work_run+0x151/0x250 kernel/task_work.c:239 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: ffff8880591fff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880591fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059200000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888059200080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888059200100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ================================================================== BUG: KASAN: use-after-free in ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] BUG: KASAN: use-after-free in __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 Read of size 4 at addr ffff888059200044 by task syz.0.20/6018 CPU: 1 UID: 0 PID: 6018 Comm: syz.0.20 Tainted: G B 6.12.0-rc7-syzkaller #0 Tainted: [B]=BAD_PAGE Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 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 ocfs2_rec_clusters fs/ocfs2/alloc.h:243 [inline] __ocfs2_find_path+0x595/0x600 fs/ocfs2/alloc.c:1825 ocfs2_find_leaf+0x99/0x1e0 fs/ocfs2/alloc.c:1938 ocfs2_get_clusters_nocache+0x39b/0xf80 fs/ocfs2/extent_map.c:418 ocfs2_get_clusters+0x337/0xc40 fs/ocfs2/extent_map.c:621 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0x1023/0x4340 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 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 RIP: 0033:0x7f344217feba Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3442ea0e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f3442ea0ef0 RCX: 00007f344217feba RDX: 0000000020004440 RSI: 0000000020000780 RDI: 00007f3442ea0eb0 RBP: 0000000020004440 R08: 00007f3442ea0ef0 R09: 0000000001000000 R10: 0000000001000000 R11: 0000000000000246 R12: 0000000020000780 R13: 00007f3442ea0eb0 R14: 000000000000444a R15: 00000000200005c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xa8c pfn:0x59200 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffff88813fffc1b8 ffffea0001560008 0000000000000000 raw: 0000000000000a8c 0000000000000009 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5951, tgid 5950 (syz.2.3), ts 98966246736, free_ts 101568110422 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1541 prep_new_page mm/page_alloc.c:1549 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3459 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4735 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 folio_alloc_mpol_noprof+0x36/0xd0 mm/mempolicy.c:2283 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1771 shmem_alloc_and_add_folio+0x48b/0xc00 mm/shmem.c:1810 shmem_get_folio_gfp+0x689/0x1530 mm/shmem.c:2332 shmem_get_folio mm/shmem.c:2438 [inline] shmem_write_begin+0x161/0x300 mm/shmem.c:3040 generic_perform_write+0x2bd/0x920 mm/filemap.c:4054 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3215 new_sync_write fs/read_write.c:590 [inline] vfs_write+0x5b1/0x1150 fs/read_write.c:683 ksys_write+0x12f/0x260 fs/read_write.c:736 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 5839 tgid 5839 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_folios+0x898/0x1220 mm/page_alloc.c:2689 folios_put_refs+0x551/0x750 mm/swap.c:1007 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x586/0x1170 mm/shmem.c:1032 shmem_truncate_range mm/shmem.c:1144 [inline] shmem_evict_inode+0x3a3/0xba0 mm/shmem.c:1274