bcachefs (loop4): reading snapshots table bcachefs (loop4): reading snapshots done bcachefs (loop4): done starting filesystem ================================================================== BUG: KASAN: slab-out-of-bounds in bch2_dirent_init_name+0x42a/0x7c0 fs/bcachefs/dirent.c:276 Write of size 1985 at addr ffff888022724041 by task syz.4.103/6582 CPU: 1 UID: 0 PID: 6582 Comm: syz.4.103 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 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:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x100/0x1b0 mm/kasan/generic.c:189 __asan_memset+0x23/0x50 mm/kasan/shadow.c:84 bch2_dirent_init_name+0x42a/0x7c0 fs/bcachefs/dirent.c:276 bch2_dirent_create_key+0x37a/0x5c0 fs/bcachefs/dirent.c:319 bch2_dirent_create+0x102/0xbc0 fs/bcachefs/dirent.c:362 bch2_link_trans+0x7d4/0xa50 fs/bcachefs/namei.c:241 __bch2_link+0x20d/0x4f0 fs/bcachefs/fs.c:776 bch2_symlink+0x160/0x200 fs/bcachefs/fs.c:892 vfs_symlink fs/namei.c:4730 [inline] vfs_symlink+0x403/0x680 fs/namei.c:4714 do_symlinkat+0x261/0x310 fs/namei.c:4756 __do_sys_symlink fs/namei.c:4777 [inline] __se_sys_symlink fs/namei.c:4775 [inline] __x64_sys_symlink+0x75/0x90 fs/namei.c:4775 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2c1ab8eec9 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:00007f2c1b9c5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 00007f2c1ade5fa0 RCX: 00007f2c1ab8eec9 RDX: 0000000000000000 RSI: 00002000000017c0 RDI: 0000200000001780 RBP: 00007f2c1ac11f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2c1ade6038 R14: 00007f2c1ade5fa0 R15: 00007ffc85821cf8 Allocated by task 6582: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4376 [inline] __kmalloc_noprof+0x223/0x510 mm/slub.c:4388 kmalloc_noprof include/linux/slab.h:909 [inline] __bch2_trans_kmalloc+0x310/0xaa0 fs/bcachefs/btree_iter.c:3242 bch2_trans_kmalloc_ip fs/bcachefs/btree_iter.h:604 [inline] bch2_trans_kmalloc fs/bcachefs/btree_iter.h:616 [inline] bch2_dirent_create_key+0x4e5/0x5c0 fs/bcachefs/dirent.c:302 bch2_dirent_create+0x102/0xbc0 fs/bcachefs/dirent.c:362 bch2_link_trans+0x7d4/0xa50 fs/bcachefs/namei.c:241 __bch2_link+0x20d/0x4f0 fs/bcachefs/fs.c:776 bch2_symlink+0x160/0x200 fs/bcachefs/fs.c:892 vfs_symlink fs/namei.c:4730 [inline] vfs_symlink+0x403/0x680 fs/namei.c:4714 do_symlinkat+0x261/0x310 fs/namei.c:4756 __do_sys_symlink fs/namei.c:4777 [inline] __se_sys_symlink fs/namei.c:4775 [inline] __x64_sys_symlink+0x75/0x90 fs/namei.c:4775 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888022724000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 65 bytes inside of allocated 2048-byte region [ffff888022724000, ffff888022724800) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22720 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b842000 ffffea00008dbe00 dead000000000002 raw: 0000000000000000 0000000080080008 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842000 ffffea00008dbe00 dead000000000002 head: 0000000000000000 0000000080080008 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea000089c801 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5875, tgid 5875 (syz-executor), ts 113933891897, free_ts 113904067915 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2492 [inline] allocate_slab mm/slub.c:2660 [inline] new_slab+0x247/0x330 mm/slub.c:2714 ___slab_alloc+0xcf2/0x1750 mm/slub.c:3901 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992 __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] __do_kmalloc_node mm/slub.c:4375 [inline] __kvmalloc_node_noprof+0x3b1/0x620 mm/slub.c:5067 kvmalloc_array_node_noprof include/linux/slab.h:1065 [inline] __ptr_ring_init_queue_alloc_noprof include/linux/ptr_ring.h:471 [inline] ptr_ring_init_noprof include/linux/ptr_ring.h:489 [inline] page_pool_init net/core/page_pool.c:266 [inline] page_pool_create_percpu+0x34e/0xcb0 net/core/page_pool.c:347 nsim_create_page_pool drivers/net/netdevsim/netdev.c:457 [inline] nsim_init_napi drivers/net/netdevsim/netdev.c:480 [inline] nsim_open+0x395/0x9d0 drivers/net/netdevsim/netdev.c:535 __dev_open+0x2e7/0x7c0 net/core/dev.c:1682 __dev_change_flags+0x55d/0x720 net/core/dev.c:9549 netif_change_flags+0x8d/0x160 net/core/dev.c:9612 do_setlink.constprop.0+0xb53/0x4380 net/core/rtnetlink.c:3143 rtnl_changelink net/core/rtnetlink.c:3761 [inline] __rtnl_newlink net/core/rtnetlink.c:3920 [inline] rtnl_newlink+0x1446/0x2000 net/core/rtnetlink.c:4057 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:6946 page last free pid 5948 tgid 5948 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895 discard_slab mm/slub.c:2758 [inline] __put_partials+0x165/0x1c0 mm/slub.c:3223 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4d/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4191 [inline] slab_alloc_node mm/slub.c:4240 [inline] __kmalloc_cache_noprof+0x1f1/0x3e0 mm/slub.c:4402 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] nsim_fib6_rt_nh_add+0x4a/0x290 drivers/net/netdevsim/fib.c:500 nsim_fib6_rt_create drivers/net/netdevsim/fib.c:562 [inline] nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:752 [inline] nsim_fib6_event drivers/net/netdevsim/fib.c:856 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:889 [inline] nsim_fib_event_work+0x196a/0x2e80 drivers/net/netdevsim/fib.c:1493 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3236 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x56d/0x730 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888022724700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888022724780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888022724800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888022724880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888022724900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================