ocfs2: Slot 0 on device (7,0) was already allocated to this node! ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ================================================================== BUG: KASAN: slab-use-after-free in ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1445 [inline] BUG: KASAN: slab-use-after-free in ocfs2_claim_suballoc_bits+0x10d3/0x2560 fs/ocfs2/suballoc.c:1982 Read of size 4 at addr ffff8880358f4000 by task syz.0.16/6011 CPU: 1 UID: 0 PID: 6011 Comm: syz.0.16 Not tainted 6.14.0-rc7-syzkaller-00067-g76b6905c11fd #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1445 [inline] ocfs2_claim_suballoc_bits+0x10d3/0x2560 fs/ocfs2/suballoc.c:1982 ocfs2_claim_new_inode+0x338/0x870 fs/ocfs2/suballoc.c:2267 ocfs2_mknod_locked+0x17a/0x3b0 fs/ocfs2/namei.c:634 ocfs2_mknod+0x17d4/0x2b30 fs/ocfs2/namei.c:381 ocfs2_create+0x1ab/0x470 fs/ocfs2/namei.c:673 lookup_open fs/namei.c:3651 [inline] open_last_lookups fs/namei.c:3750 [inline] path_openat+0x193c/0x3590 fs/namei.c:3986 do_filp_open+0x27f/0x4e0 fs/namei.c:4016 do_sys_openat2+0x13e/0x1d0 fs/open.c:1428 do_sys_open fs/open.c:1443 [inline] __do_sys_openat fs/open.c:1459 [inline] __se_sys_openat fs/open.c:1454 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1454 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fbfded8d169 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:00007ffd97fd1ca8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fbfdefa5fa0 RCX: 00007fbfded8d169 RDX: 0000000000105042 RSI: 0000400000000080 RDI: ffffffffffffff9c RBP: 00007fbfdee0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000001db R11: 0000000000000246 R12: 0000000000000000 R13: 00007fbfdefa5fa0 R14: 00007fbfdefa5fa0 R15: 0000000000000004 Allocated by task 5882: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4294 [inline] __kmalloc_node_noprof+0x290/0x4d0 mm/slub.c:4300 __kvmalloc_node_noprof+0x72/0x190 mm/util.c:665 allocate_hook_entries_size net/netfilter/core.c:61 [inline] nf_hook_entries_grow+0x288/0x720 net/netfilter/core.c:140 __nf_register_net_hook+0x278/0x8d0 net/netfilter/core.c:435 nf_register_net_hook+0xb0/0x190 net/netfilter/core.c:578 nf_register_net_hooks+0x41/0x1a0 net/netfilter/core.c:594 nf_nat_register_fn+0x3ae/0x570 net/netfilter/nf_nat_core.c:1240 ipt_nat_register_lookups net/ipv4/netfilter/iptable_nat.c:77 [inline] iptable_nat_table_init+0xd4/0x2d0 net/ipv4/netfilter/iptable_nat.c:121 xt_find_table_lock+0x322/0x400 net/netfilter/x_tables.c:1260 xt_request_find_table_lock+0x26/0x100 net/netfilter/x_tables.c:1285 get_info net/ipv4/netfilter/ip_tables.c:963 [inline] do_ipt_get_ctl+0x890/0x18b0 net/ipv4/netfilter/ip_tables.c:1659 nf_getsockopt+0x299/0x2c0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x222/0x2e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x163/0x1c0 net/ipv4/tcp.c:4684 do_sock_getsockopt+0x38e/0x740 net/socket.c:2364 __sys_getsockopt net/socket.c:2393 [inline] __do_sys_getsockopt net/socket.c:2400 [inline] __se_sys_getsockopt net/socket.c:2397 [inline] __x64_sys_getsockopt+0x2a1/0x370 net/socket.c:2397 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 17: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x196/0x430 mm/slub.c:4757 rcu_do_batch kernel/rcu/tree.c:2546 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2802 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 kasan_record_aux_stack+0xaa/0xc0 mm/kasan/generic.c:548 __call_rcu_common kernel/rcu/tree.c:3065 [inline] call_rcu+0x168/0xac0 kernel/rcu/tree.c:3172 nf_hook_entries_free net/netfilter/core.c:88 [inline] __nf_register_net_hook+0x71e/0x8d0 net/netfilter/core.c:457 nf_register_net_hook+0xb0/0x190 net/netfilter/core.c:578 nf_register_net_hooks+0x41/0x1a0 net/netfilter/core.c:594 ipt_register_table+0x4a2/0x740 net/ipv4/netfilter/ip_tables.c:1781 iptable_mangle_table_init+0x42/0x70 net/ipv4/netfilter/iptable_mangle.c:92 xt_find_table_lock+0x322/0x400 net/netfilter/x_tables.c:1260 xt_request_find_table_lock+0x26/0x100 net/netfilter/x_tables.c:1285 get_info net/ipv4/netfilter/ip_tables.c:963 [inline] do_ipt_get_ctl+0x890/0x18b0 net/ipv4/netfilter/ip_tables.c:1659 nf_getsockopt+0x299/0x2c0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x222/0x2e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x163/0x1c0 net/ipv4/tcp.c:4684 do_sock_getsockopt+0x38e/0x740 net/socket.c:2364 __sys_getsockopt net/socket.c:2393 [inline] __do_sys_getsockopt net/socket.c:2400 [inline] __se_sys_getsockopt net/socket.c:2397 [inline] __x64_sys_getsockopt+0x2a1/0x370 net/socket.c:2397 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880358f4000 which belongs to the cache kmalloc-cg-64 of size 64 The buggy address is located 0 bytes inside of freed 64-byte region [ffff8880358f4000, ffff8880358f4040) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x358f4 memcg:ffff888033ef2001 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b04dc80 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000200020 00000000f5000000 ffff888033ef2001 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5882, tgid 5882 (syz-executor), ts 119351099936, free_ts 119350907007 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4740 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_node_noprof+0x2ee/0x4d0 mm/slub.c:4300 __kvmalloc_node_noprof+0x72/0x190 mm/util.c:665 allocate_hook_entries_size net/netfilter/core.c:61 [inline] nf_hook_entries_grow+0x288/0x720 net/netfilter/core.c:140 __nf_register_net_hook+0x278/0x8d0 net/netfilter/core.c:435 nf_register_net_hook+0xb0/0x190 net/netfilter/core.c:578 nf_register_net_hooks+0x41/0x1a0 net/netfilter/core.c:594 nf_nat_register_fn+0x3ae/0x570 net/netfilter/nf_nat_core.c:1240 ipt_nat_register_lookups net/ipv4/netfilter/iptable_nat.c:77 [inline] iptable_nat_table_init+0xd4/0x2d0 net/ipv4/netfilter/iptable_nat.c:121 xt_find_table_lock+0x322/0x400 net/netfilter/x_tables.c:1260 page last free pid 5882 tgid 5882 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe04/0x10e0 mm/page_alloc.c:2660 vfree+0x1c3/0x360 mm/vmalloc.c:3383 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:866 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1022 [inline] do_ipt_get_ctl+0x1238/0x18b0 net/ipv4/netfilter/ip_tables.c:1668 nf_getsockopt+0x299/0x2c0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x222/0x2e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x163/0x1c0 net/ipv4/tcp.c:4684 do_sock_getsockopt+0x38e/0x740 net/socket.c:2364 __sys_getsockopt net/socket.c:2393 [inline] __do_sys_getsockopt net/socket.c:2400 [inline] __se_sys_getsockopt net/socket.c:2397 [inline] __x64_sys_getsockopt+0x2a1/0x370 net/socket.c:2397 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880358f3f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880358f3f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880358f4000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880358f4080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880358f4100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================