loop3: detected capacity change from 0 to 262144 ================================================================== BUG: KASAN: slab-out-of-bounds in sanity_check_valid_blocks fs/f2fs/segment.h:385 [inline] BUG: KASAN: slab-out-of-bounds in build_sit_entries+0x1a19/0x1c10 fs/f2fs/segment.c:5060 Read of size 4 at addr ffff88815f844a20 by task syz.3.16/3568 CPU: 1 UID: 0 PID: 3568 Comm: syz.3.16 Not tainted 6.15.0-rc1-syzkaller #0 PREEMPT(undef) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0xf4/0x170 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 sanity_check_valid_blocks fs/f2fs/segment.h:385 [inline] build_sit_entries+0x1a19/0x1c10 fs/f2fs/segment.c:5060 f2fs_build_segment_manager+0x2ac6/0x4560 fs/f2fs/segment.c:5707 f2fs_fill_super+0x39a9/0x5ea0 fs/f2fs/super.c:4747 mount_bdev+0x1df/0x270 fs/super.c:1693 legacy_get_tree+0xf5/0x190 fs/fs_context.c:662 vfs_get_tree+0x84/0x1a0 fs/super.c:1759 do_new_mount+0x1c7/0x850 fs/namespace.c:3879 do_mount fs/namespace.c:4219 [inline] __do_sys_mount fs/namespace.c:4430 [inline] __se_sys_mount+0x218/0x2b0 fs/namespace.c:4407 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x8f/0x170 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa46159010a 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:00007fa4624d8e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fa4624d8ef0 RCX: 00007fa46159010a RDX: 0000200000020440 RSI: 0000200000020480 RDI: 00007fa4624d8eb0 RBP: 0000200000020440 R08: 00007fa4624d8ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000020480 R13: 00007fa4624d8eb0 R14: 000000000002041f R15: 00002000000204c0 Allocated by task 3568: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4331 [inline] __kvmalloc_node_noprof+0x2e8/0x5a0 mm/slub.c:5016 f2fs_kvmalloc fs/f2fs/f2fs.h:3534 [inline] f2fs_kvzalloc fs/f2fs/f2fs.h:3540 [inline] build_sit_info fs/f2fs/segment.c:4779 [inline] f2fs_build_segment_manager+0x11c4/0x4560 fs/f2fs/segment.c:5696 f2fs_fill_super+0x39a9/0x5ea0 fs/f2fs/super.c:4747 mount_bdev+0x1df/0x270 fs/super.c:1693 legacy_get_tree+0xf5/0x190 fs/fs_context.c:662 vfs_get_tree+0x84/0x1a0 fs/super.c:1759 do_new_mount+0x1c7/0x850 fs/namespace.c:3879 do_mount fs/namespace.c:4219 [inline] __do_sys_mount fs/namespace.c:4430 [inline] __se_sys_mount+0x218/0x2b0 fs/namespace.c:4407 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x8f/0x170 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88815f844000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 0 bytes to the right of allocated 2592-byte region [ffff88815f844000, ffff88815f844a20) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x15f840 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x100000000000040(head|node=0|zone=2) page_type: f5(slab) raw: 0100000000000040 ffff888100042140 ffffea0004443400 dead000000000002 raw: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 0100000000000040 ffff888100042140 ffffea0004443400 dead000000000002 head: 0000000000000000 0000000000040004 00000000f5000000 0000000000000000 head: 0100000000000003 ffffea00057e1001 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3146, tgid 3146 (syz-executor), ts 79157622825, free_ts 50082754089 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xec/0x120 mm/page_alloc.c:1717 prep_new_page mm/page_alloc.c:1725 [inline] get_page_from_freelist+0x3bee/0x3d50 mm/page_alloc.c:3652 __alloc_frozen_pages_noprof+0x26b/0x460 mm/page_alloc.c:4934 alloc_pages_mpol+0x150/0x320 mm/mempolicy.c:2301 alloc_slab_page mm/slub.c:2459 [inline] allocate_slab+0x8a/0x350 mm/slub.c:2623 new_slab mm/slub.c:2676 [inline] ___slab_alloc+0x9dc/0x10e0 mm/slub.c:3862 __slab_alloc mm/slub.c:3952 [inline] __slab_alloc_node mm/slub.c:4027 [inline] slab_alloc_node mm/slub.c:4188 [inline] __do_kmalloc_node mm/slub.c:4330 [inline] __kmalloc_noprof+0x2e8/0x500 mm/slub.c:4343 kmalloc_noprof include/linux/slab.h:909 [inline] tomoyo_realpath_from_path+0xf5/0x550 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x1a6/0x520 security/tomoyo/file.c:771 security_file_open+0x4d/0x100 security/security.c:3114 do_dentry_open+0x304/0x1520 fs/open.c:933 vfs_open+0x36/0x2b0 fs/open.c:1086 do_open fs/namei.c:3845 [inline] path_openat+0x23e3/0x2bb0 fs/namei.c:4004 do_filp_open+0x1e4/0x3c0 fs/namei.c:4031 do_sys_openat2+0xfa/0x180 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_openat fs/open.c:1460 [inline] __se_sys_openat fs/open.c:1455 [inline] __x64_sys_openat+0xf3/0x120 fs/open.c:1455 page last free pid 1754 tgid 1748 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] free_unref_folios+0xb52/0x12c0 mm/page_alloc.c:2737 folios_put_refs+0x3af/0x4b0 mm/swap.c:992 free_pages_and_swap_cache+0x20d/0x3c0 mm/swap_state.c:267 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:397 [inline] tlb_flush_mmu+0x2ba/0x500 mm/mmu_gather.c:404 tlb_finish_mmu+0xaa/0x190 mm/mmu_gather.c:496 exit_mmap+0x3b5/0x8b0 mm/mmap.c:1297 __mmput+0x9c/0x320 kernel/fork.c:1379 exit_mm+0x11b/0x1b0 kernel/exit.c:589 do_exit+0x66b/0x2020 kernel/exit.c:940 do_group_exit+0x1b1/0x280 kernel/exit.c:1102 get_signal+0xd79/0xeb0 kernel/signal.c:3034 arch_do_signal_or_restart+0x90/0x5c0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x68/0xc0 kernel/entry/common.c:218 do_syscall_64+0x9c/0x170 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88815f844900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88815f844980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88815f844a00: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88815f844a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88815f844b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================