RBP: 00007f3af92ccb39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3af9472080 R15: 00007ffc3fb78b18 ---[ end trace f0c59faaa5b1fa74 ]--- ================================================================== BUG: KASAN: slab-out-of-bounds in __set_sit_entry_type fs/f2fs/segment.c:2257 [inline] BUG: KASAN: slab-out-of-bounds in reset_curseg+0x4dd/0x560 fs/f2fs/segment.c:2663 Read of size 4 at addr ffff88813927e3c0 by task syz.1.784/3422 CPU: 1 PID: 3422 Comm: syz.1.784 Tainted: G W 5.10.238-syzkaller-00008-g59e9a7228857 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 __set_sit_entry_type fs/f2fs/segment.c:2257 [inline] reset_curseg+0x4dd/0x560 fs/f2fs/segment.c:2663 new_curseg+0x12f6/0x18a0 fs/f2fs/segment.c:2723 __allocate_new_segment+0x13d/0x810 fs/f2fs/segment.c:3039 __allocate_new_section fs/f2fs/segment.c:3047 [inline] f2fs_allocate_new_section+0x1d5/0x280 fs/f2fs/segment.c:3054 expand_inode_data+0x5a8/0x930 fs/f2fs/file.c:1720 f2fs_fallocate+0x42b/0x7e0 fs/f2fs/file.c:1825 vfs_fallocate+0x4b4/0x590 fs/open.c:310 ioctl_preallocate fs/ioctl.c:494 [inline] file_ioctl fs/ioctl.c:-1 [inline] do_vfs_ioctl+0x12e3/0x1510 fs/ioctl.c:732 __do_sys_ioctl fs/ioctl.c:751 [inline] __se_sys_ioctl+0x9f/0x1a0 fs/ioctl.c:739 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f3af924a929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f3af7892038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f3af9472080 RCX: 00007f3af924a929 RDX: 00002000000000c0 RSI: 0000000040305828 RDI: 0000000000000048 RBP: 00007f3af92ccb39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3af9472080 R15: 00007ffc3fb78b18 Allocated by task 3424: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc mm/kasan/common.c:509 [inline] __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] __kmalloc+0x1a7/0x330 mm/slub.c:4033 __kmalloc_node include/linux/slab.h:418 [inline] kmalloc_node include/linux/slab.h:575 [inline] kvmalloc_node+0x88/0x130 mm/util.c:612 kvmalloc include/linux/mm.h:822 [inline] f2fs_kvmalloc fs/f2fs/f2fs.h:3368 [inline] f2fs_kvzalloc fs/f2fs/f2fs.h:3374 [inline] build_sit_info fs/f2fs/segment.c:4395 [inline] f2fs_build_segment_manager+0xdba/0x48f0 fs/f2fs/segment.c:5258 f2fs_fill_super+0x42d1/0x6c70 fs/f2fs/super.c:4268 mount_bdev+0x28b/0x3a0 fs/super.c:1442 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4548 legacy_get_tree+0xed/0x190 fs/fs_context.c:593 vfs_get_tree+0x89/0x260 fs/super.c:1572 do_new_mount+0x25a/0xa20 fs/namespace.c:2915 path_mount+0x572/0xc80 fs/namespace.c:3245 do_mount fs/namespace.c:3258 [inline] __do_sys_mount fs/namespace.c:3466 [inline] __se_sys_mount+0x318/0x380 fs/namespace.c:3443 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3443 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88813927e000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 960 bytes inside of 1024-byte region [ffff88813927e000, ffff88813927e400) The buggy address belongs to the page: page:ffffea0004e49e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x139278 head:ffffea0004e49e00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3425, ts 267693195743, free_ts 105869612734 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5357 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1808 [inline] new_slab+0x84/0x3f0 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x2a6/0x450 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] __kmalloc_track_caller+0x1ef/0x320 mm/slub.c:4536 __kmalloc_reserve net/core/skbuff.c:144 [inline] __alloc_skb+0xdc/0x520 net/core/skbuff.c:212 alloc_skb include/linux/skbuff.h:1126 [inline] nlmsg_new include/net/netlink.h:953 [inline] rtmsg_fib+0x60a/0xd90 net/ipv4/fib_semantics.c:522 fib_table_insert+0xac2/0x1bb0 net/ipv4/fib_trie.c:1335 fib_magic net/ipv4/fib_frontend.c:1107 [inline] fib_add_ifaddr+0xb18/0xed0 net/ipv4/fib_frontend.c:1153 fib_netdev_event+0x231/0x5d0 net/ipv4/fib_frontend.c:1491 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers net/core/dev.c:2080 [inline] __dev_notify_flags+0x28f/0x500 net/core/dev.c:-1 dev_change_flags+0xe8/0x1a0 net/core/dev.c:8610 do_setlink+0xbb4/0x3ab0 net/core/rtnetlink.c:2732 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] __free_pages_ok+0x7fc/0x820 mm/page_alloc.c:1629 free_the_page mm/page_alloc.c:5418 [inline] __free_pages+0xdd/0x380 mm/page_alloc.c:5427 free_pages+0x82/0x90 mm/page_alloc.c:5438 free_pg_vec net/packet/af_packet.c:4348 [inline] packet_set_ring+0x18f3/0x23d0 net/packet/af_packet.c:4567 packet_release+0x728/0xc60 net/packet/af_packet.c:3164 __sock_release net/socket.c:597 [inline] sock_close+0xe0/0x270 net/socket.c:1286 __fput+0x2fb/0x770 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x127/0x190 kernel/task_work.c:189 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xcb/0xe0 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0x68/0x90 kernel/entry/common.c:274 do_syscall_64+0x3d/0x40 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88813927e280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88813927e300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88813927e380: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff88813927e400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88813927e480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 PID: 3422 Comm: syz.1.784 Tainted: G B W 5.10.238-syzkaller-00008-g59e9a7228857 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 RIP: 0010:update_sit_entry+0x3eb/0xf50 fs/f2fs/segment.c:-1 Code: 89 45 a8 49 01 c5 41 f6 d7 41 80 e7 07 44 89 f9 41 bf 01 00 00 00 41 d3 e7 4d 89 ee 49 c1 ee 03 48 b8 00 00 00 00 00 fc ff df <41> 0f b6 04 06 84 c0 0f 85 a5 08 00 00 41 0f b6 5d 00 44 89 f8 41 RSP: 0018:ffffc900010ef350 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff88813927e3c8 RCX: 0000000000000007 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88813927e3c8 RBP: ffffc900010ef3d0 R08: ffff888115d593c0 R09: 0000000000000003 R10: 00000000ffffffff R11: 0000000000000000 R12: 0000000000004000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000080 FS: 00007f3af78926c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000001119db000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: f2fs_allocate_data_block+0x156b/0x3a10 fs/f2fs/segment.c:3481 __allocate_data_block+0x52a/0x980 fs/f2fs/data.c:1407 f2fs_map_blocks+0xdc8/0x35c0 fs/f2fs/data.c:1575 expand_inode_data+0x5d7/0x930 fs/f2fs/file.c:1724 f2fs_fallocate+0x42b/0x7e0 fs/f2fs/file.c:1825 vfs_fallocate+0x4b4/0x590 fs/open.c:310 ioctl_preallocate fs/ioctl.c:494 [inline] file_ioctl fs/ioctl.c:-1 [inline] do_vfs_ioctl+0x12e3/0x1510 fs/ioctl.c:732 __do_sys_ioctl fs/ioctl.c:751 [inline] __se_sys_ioctl+0x9f/0x1a0 fs/ioctl.c:739 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f3af924a929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f3af7892038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f3af9472080 RCX: 00007f3af924a929 RDX: 00002000000000c0 RSI: 0000000040305828 RDI: 0000000000000048 RBP: 00007f3af92ccb39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3af9472080 R15: 00007ffc3fb78b18 Modules linked in: ---[ end trace f0c59faaa5b1fa75 ]--- RIP: 0010:update_sit_entry+0x3eb/0xf50 fs/f2fs/segment.c:-1 Code: 89 45 a8 49 01 c5 41 f6 d7 41 80 e7 07 44 89 f9 41 bf 01 00 00 00 41 d3 e7 4d 89 ee 49 c1 ee 03 48 b8 00 00 00 00 00 fc ff df <41> 0f b6 04 06 84 c0 0f 85 a5 08 00 00 41 0f b6 5d 00 44 89 f8 41 RSP: 0018:ffffc900010ef350 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff88813927e3c8 RCX: 0000000000000007 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88813927e3c8 RBP: ffffc900010ef3d0 R08: ffff888115d593c0 R09: 0000000000000003 R10: 00000000ffffffff R11: 0000000000000000 R12: 0000000000004000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000080 FS: 00007f3af78926c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fb3b1281000 CR3: 00000001119db000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 89 45 a8 mov %eax,-0x58(%rbp) 3: 49 01 c5 add %rax,%r13 6: 41 f6 d7 not %r15b 9: 41 80 e7 07 and $0x7,%r15b d: 44 89 f9 mov %r15d,%ecx 10: 41 bf 01 00 00 00 mov $0x1,%r15d 16: 41 d3 e7 shl %cl,%r15d 19: 4d 89 ee mov %r13,%r14 1c: 49 c1 ee 03 shr $0x3,%r14 20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 27: fc ff df * 2a: 41 0f b6 04 06 movzbl (%r14,%rax,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 0f 85 a5 08 00 00 jne 0x8dc 37: 41 0f b6 5d 00 movzbl 0x0(%r13),%ebx 3c: 44 89 f8 mov %r15d,%eax 3f: 41 rex.B