bcachefs (loop0): bucket 0:38 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 7589ab5e0c11cc7a written 24 min_key POS_MIN durability: 1 ptr: 0:38:0 gen 0, fixing bcachefs (loop0): bucket 0:41 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 9aa2895aefce4bdf written 24 min_key POS_MIN durability: 1 ptr: 0:41:0 gen 0, fixing bcachefs (loop0): bucket 0:35 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq c0bef60d07ceb940 written 16 min_key POS_MIN durability: 1 ptr: 0:35:0 gen 0, fixing bcachefs (loop0): bucket 0:29 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq e81e1ed936acf3df written 32 min_key POS_MIN durability: 1 ptr: 0:29:0 gen 0, fixing bcachefs (loop0): bucket 0:1 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:1 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:2 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:2 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:3 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:3 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:4 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:4 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:5 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:5 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:6 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:6 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:7 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:7 gen 0 data type sb has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:8 gen 0 has wrong data_type: got free, should be sb, fixing bcachefs (loop0): bucket 0:8 gen 0 data type sb has wrong dirty_sectors: got 0, should be 8, fixing bcachefs (loop0): bucket 0:9 gen 0 has wrong data_type: got free, should be journal, fixing bcachefs (loop0): bucket 0:9 gen 0 data type journal has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:10 gen 0 has wrong data_type: got free, should be journal, fixing bcachefs (loop0): bucket 0:10 gen 0 data type journal has wrong dirty_sectors: got 0, should be 256, fixing bcachefs (loop0): bucket 0:11 gen 0 has wrong data_type: got free, should be journal, fixing Ratelimiting new instances of previous error bcachefs (loop0): bucket 0:11 gen 0 data type journal has wrong dirty_sectors: got 0, should be 256, fixing Ratelimiting new instances of previous error done bcachefs (loop0): going read-write bcachefs (loop0): journal_replay... done bcachefs (loop0): check_extents_to_backpointers... bcachefs (loop0): scanning for missing backpointers in 5/128 buckets done bcachefs (loop0): check_subvols... done bcachefs (loop0): check_inodes... done bcachefs (loop0): check_dirents... bcachefs (loop0): dirent points to missing inode: u64s 7 type dirent 4096:1896155912177158345:U32_MAX len 0 ver 0: file3 -> 536870913 type reg, fixing bcachefs (loop0): dirent points to missing inode: u64s 7 type dirent 4096:2695648408715017799:U32_MAX len 0 ver 0: file2 -> 536870913 type reg, fixing bcachefs (loop0): hash table key at wrong offset: should be at 5178636093158006573 u64s 8 type dirent 4096:8130059955150870709:U32_MAX len 0 ver 0: lost+foun -> 4097 type dir, fixing bcachefs (loop0): dirent points to missing inode: u64s 8 type dirent 4096:9097378837824744618:U32_MAX len 0 ver 0: file.cold -> 172335562754 type reg, fixing ================================================================== BUG: KASAN: slab-use-after-free in check_dirent fs/bcachefs/fsck.c:2396 [inline] BUG: KASAN: slab-use-after-free in bch2_check_dirents+0x1fac/0x33f0 fs/bcachefs/fsck.c:2422 Read of size 1 at addr ffff888055ac0190 by task syz.0.0/5367 CPU: 0 UID: 0 PID: 5367 Comm: syz.0.0 Not tainted 6.17.0-rc1-syzkaller-00150-g8d084337a32f #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 check_dirent fs/bcachefs/fsck.c:2396 [inline] bch2_check_dirents+0x1fac/0x33f0 fs/bcachefs/fsck.c:2422 bch2_run_recovery_pass fs/bcachefs/recovery_passes.c:484 [inline] __bch2_run_recovery_passes+0x3bd/0x1060 fs/bcachefs/recovery_passes.c:539 bch2_run_recovery_passes+0x184/0x210 fs/bcachefs/recovery_passes.c:610 bch2_fs_recovery+0x2690/0x3a50 fs/bcachefs/recovery.c:1016 bch2_fs_start+0xaaf/0xda0 fs/bcachefs/super.c:1213 bch2_fs_get_tree+0xb39/0x1520 fs/bcachefs/fs.c:2488 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4321 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc80ab9038a 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:00007fc80b948e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fc80b948ef0 RCX: 00007fc80ab9038a RDX: 0000200000000080 RSI: 00002000000000c0 RDI: 00007fc80b948eb0 RBP: 0000200000000080 R08: 00007fc80b948ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00002000000000c0 R13: 00007fc80b948eb0 R14: 0000000000005993 R15: 00002000000001c0 Allocated by task 3053: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:330 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:356 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] slab_alloc_node mm/slub.c:4229 [inline] kmem_cache_alloc_node_noprof+0x1bb/0x3c0 mm/slub.c:4281 kmalloc_reserve+0xbd/0x290 net/core/skbuff.c:578 __alloc_skb+0x142/0x2d0 net/core/skbuff.c:669 alloc_skb include/linux/skbuff.h:1336 [inline] synproxy_send_client_synack+0x16c/0xe20 net/netfilter/nf_synproxy_core.c:460 nft_synproxy_eval_v4+0x36e/0x560 net/netfilter/nft_synproxy.c:59 nft_synproxy_do_eval+0x345/0x570 net/netfilter/nft_synproxy.c:141 expr_call_ops_eval net/netfilter/nf_tables_core.c:237 [inline] nft_do_chain+0x40c/0x1920 net/netfilter/nf_tables_core.c:285 nft_do_chain_inet+0x25d/0x340 net/netfilter/nft_chain_filter.c:161 nf_hook_entry_hookfn include/linux/netfilter.h:158 [inline] nf_hook_slow+0xc5/0x220 net/netfilter/core.c:623 nf_hook include/linux/netfilter.h:273 [inline] NF_HOOK+0x206/0x3a0 include/linux/netfilter.h:316 NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318 __netif_receive_skb_one_core net/core/dev.c:5979 [inline] __netif_receive_skb+0x143/0x380 net/core/dev.c:6092 process_backlog+0x60e/0x14f0 net/core/dev.c:6444 __napi_poll+0xc7/0x360 net/core/dev.c:7494 napi_poll net/core/dev.c:7557 [inline] net_rx_action+0x707/0xe30 net/core/dev.c:7684 handle_softirqs+0x283/0x870 kernel/softirq.c:579 do_softirq+0xec/0x180 kernel/softirq.c:480 __local_bh_enable_ip+0x17d/0x1c0 kernel/softirq.c:407 addrconf_dad_work+0xd83/0x14b0 net/ipv6/addrconf.c:4266 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 3053: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kmem_cache_free+0x18f/0x400 mm/slub.c:4782 skb_release_data+0x62d/0x7c0 net/core/skbuff.c:1086 skb_release_all net/core/skbuff.c:1151 [inline] __kfree_skb net/core/skbuff.c:1165 [inline] consume_skb+0x9e/0xf0 net/core/skbuff.c:1397 nft_synproxy_eval_v4+0x376/0x560 net/netfilter/nft_synproxy.c:60 nft_synproxy_do_eval+0x345/0x570 net/netfilter/nft_synproxy.c:141 expr_call_ops_eval net/netfilter/nf_tables_core.c:237 [inline] nft_do_chain+0x40c/0x1920 net/netfilter/nf_tables_core.c:285 nft_do_chain_inet+0x25d/0x340 net/netfilter/nft_chain_filter.c:161 nf_hook_entry_hookfn include/linux/netfilter.h:158 [inline] nf_hook_slow+0xc5/0x220 net/netfilter/core.c:623 nf_hook include/linux/netfilter.h:273 [inline] NF_HOOK+0x206/0x3a0 include/linux/netfilter.h:316 NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318 __netif_receive_skb_one_core net/core/dev.c:5979 [inline] __netif_receive_skb+0x143/0x380 net/core/dev.c:6092 process_backlog+0x60e/0x14f0 net/core/dev.c:6444 __napi_poll+0xc7/0x360 net/core/dev.c:7494 napi_poll net/core/dev.c:7557 [inline] net_rx_action+0x707/0xe30 net/core/dev.c:7684 handle_softirqs+0x283/0x870 kernel/softirq.c:579 do_softirq+0xec/0x180 kernel/softirq.c:480 __local_bh_enable_ip+0x17d/0x1c0 kernel/softirq.c:407 addrconf_dad_work+0xd83/0x14b0 net/ipv6/addrconf.c:4266 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888055ac0000 which belongs to the cache skbuff_small_head of size 704 The buggy address is located 400 bytes inside of freed 704-byte region [ffff888055ac0000, ffff888055ac02c0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x55ac0 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff8880304eb000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000130013 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff8880304eb000 dead000000000122 0000000000000000 head: 0000000000000000 0000000000130013 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffea000156b001 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3053, tgid 3053 (kworker/u4:11), ts 87426204296, free_ts 87400383393 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] kmem_cache_alloc_node_noprof+0x280/0x3c0 mm/slub.c:4281 kmalloc_reserve+0xbd/0x290 net/core/skbuff.c:578 __alloc_skb+0x142/0x2d0 net/core/skbuff.c:669 alloc_skb include/linux/skbuff.h:1336 [inline] synproxy_send_client_synack+0x16c/0xe20 net/netfilter/nf_synproxy_core.c:460 nft_synproxy_eval_v4+0x36e/0x560 net/netfilter/nft_synproxy.c:59 nft_synproxy_do_eval+0x345/0x570 net/netfilter/nft_synproxy.c:141 expr_call_ops_eval net/netfilter/nf_tables_core.c:237 [inline] nft_do_chain+0x40c/0x1920 net/netfilter/nf_tables_core.c:285 nft_do_chain_inet+0x25d/0x340 net/netfilter/nft_chain_filter.c:161 nf_hook_entry_hookfn include/linux/netfilter.h:158 [inline] nf_hook_slow+0xc5/0x220 net/netfilter/core.c:623 nf_hook include/linux/netfilter.h:273 [inline] NF_HOOK+0x206/0x3a0 include/linux/netfilter.h:316 page last free pid 5367 tgid 5366 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_pages_ok+0xa83/0xbe0 mm/page_alloc.c:1571 free_large_kmalloc+0x13a/0x1f0 mm/slub.c:4805 btree_bounce_free fs/bcachefs/btree_io.c:115 [inline] btree_node_sort+0x117f/0x1760 fs/bcachefs/btree_io.c:383 bch2_btree_post_write_cleanup+0x11f/0xad0 fs/bcachefs/btree_io.c:2607 bch2_btree_node_prep_for_write+0x337/0x650 fs/bcachefs/btree_trans_commit.c:95 bch2_trans_lock_write+0x669/0xba0 fs/bcachefs/btree_trans_commit.c:131 do_bch2_trans_commit fs/bcachefs/btree_trans_commit.c:850 [inline] __bch2_trans_commit+0x2773/0x8870 fs/bcachefs/btree_trans_commit.c:1085 bch2_trans_commit fs/bcachefs/btree_update.h:241 [inline] check_dirent fs/bcachefs/fsck.c:2391 [inline] bch2_check_dirents+0x1c5c/0x33f0 fs/bcachefs/fsck.c:2422 bch2_run_recovery_pass fs/bcachefs/recovery_passes.c:484 [inline] __bch2_run_recovery_passes+0x3bd/0x1060 fs/bcachefs/recovery_passes.c:539 bch2_run_recovery_passes+0x184/0x210 fs/bcachefs/recovery_passes.c:610 bch2_fs_recovery+0x2690/0x3a50 fs/bcachefs/recovery.c:1016 bch2_fs_start+0xaaf/0xda0 fs/bcachefs/super.c:1213 bch2_fs_get_tree+0xb39/0x1520 fs/bcachefs/fs.c:2488 vfs_get_tree+0x8f/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805 do_mount fs/namespace.c:4133 [inline] __do_sys_mount fs/namespace.c:4344 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4321 Memory state around the buggy address: ffff888055ac0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888055ac0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888055ac0180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888055ac0200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888055ac0280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================