================================================================== BUG: KASAN: slab-out-of-bounds in get_unaligned_le64 include/asm-generic/unaligned.h:37 [inline] BUG: KASAN: slab-out-of-bounds in bch2_varint_decode_fast+0x1b5/0x1e0 fs/bcachefs/varint.c:114 Read of size 8 at addr ffff88802814bc7f by task syz-executor.4/27164 CPU: 1 PID: 27164 Comm: syz-executor.4 Not tainted 6.9.0-rc7-syzkaller-00012-gdccb07f2914c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 get_unaligned_le64 include/asm-generic/unaligned.h:37 [inline] bch2_varint_decode_fast+0x1b5/0x1e0 fs/bcachefs/varint.c:114 bch2_inode_unpack_v3+0xf3d/0x2060 fs/bcachefs/inode.c:270 bch2_inode_unpack fs/bcachefs/inode.c:323 [inline] __bch2_inode_invalid+0x1a2/0x4d0 fs/bcachefs/inode.c:449 bch2_inode_v3_invalid+0x1f1/0x2e0 fs/bcachefs/inode.c:529 bch2_bkey_val_invalid+0x1cb/0x290 fs/bcachefs/bkey_methods.c:140 bch2_bkey_invalid+0x86/0x90 fs/bcachefs/bkey_methods.c:231 __bch2_trans_commit+0x7ea/0x7880 fs/bcachefs/btree_trans_commit.c:1008 bch2_trans_commit fs/bcachefs/btree_update.h:168 [inline] bch2_extent_update+0x494/0xa40 fs/bcachefs/io_write.c:318 bch2_write_index_default+0x8d7/0xb70 fs/bcachefs/io_write.c:366 __bch2_write_index+0x5ee/0xa60 fs/bcachefs/io_write.c:520 bch2_write_data_inline fs/bcachefs/io_write.c:1538 [inline] bch2_write+0x1113/0x1400 fs/bcachefs/io_write.c:1606 bch2_writepages+0x136/0x200 fs/bcachefs/fs-io-buffered.c:660 do_writepages+0x1a3/0x7f0 mm/page-writeback.c:2612 filemap_fdatawrite_wbc mm/filemap.c:397 [inline] filemap_fdatawrite_wbc+0x148/0x1c0 mm/filemap.c:387 __filemap_fdatawrite_range+0xba/0x100 mm/filemap.c:430 filemap_write_and_wait_range mm/filemap.c:685 [inline] filemap_write_and_wait_range+0xa3/0x130 mm/filemap.c:676 bch2_symlink+0x13a/0x200 fs/bcachefs/fs.c:587 vfs_symlink fs/namei.c:4481 [inline] vfs_symlink+0x3e8/0x630 fs/namei.c:4465 do_symlinkat+0x263/0x310 fs/namei.c:4507 __do_sys_symlinkat fs/namei.c:4523 [inline] __se_sys_symlinkat fs/namei.c:4520 [inline] __x64_sys_symlinkat+0x97/0xc0 fs/namei.c:4520 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f741687dd69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f741765e0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000010a RAX: ffffffffffffffda RBX: 00007f74169abf80 RCX: 00007f741687dd69 RDX: 0000000020000180 RSI: 0000000000000004 RDI: 0000000020000140 RBP: 00007f74168ca49e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f74169abf80 R15: 00007ffde5c73ad8 Allocated by task 27164: 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:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3972 [inline] __kmalloc_node_track_caller+0x220/0x480 mm/slub.c:3992 __do_krealloc mm/slab_common.c:1192 [inline] krealloc+0x5d/0x100 mm/slab_common.c:1225 __bch2_trans_kmalloc+0x392/0xbf0 fs/bcachefs/btree_iter.c:2831 bch2_trans_kmalloc_nomemzero fs/bcachefs/btree_iter.h:537 [inline] __bch2_bkey_make_mut_noupdate.constprop.0+0x3c9/0x4e0 fs/bcachefs/btree_update.h:223 __bch2_bkey_get_mut_noupdate fs/bcachefs/btree_update.h:282 [inline] bch2_bkey_get_mut_noupdate fs/bcachefs/btree_update.h:293 [inline] bch2_extent_update_i_size_sectors+0x33d/0x760 fs/bcachefs/io_write.c:219 bch2_extent_update+0x3db/0xa40 fs/bcachefs/io_write.c:314 bch2_write_index_default+0x8d7/0xb70 fs/bcachefs/io_write.c:366 __bch2_write_index+0x5ee/0xa60 fs/bcachefs/io_write.c:520 bch2_write_data_inline fs/bcachefs/io_write.c:1538 [inline] bch2_write+0x1113/0x1400 fs/bcachefs/io_write.c:1606 bch2_writepages+0x136/0x200 fs/bcachefs/fs-io-buffered.c:660 do_writepages+0x1a3/0x7f0 mm/page-writeback.c:2612 filemap_fdatawrite_wbc mm/filemap.c:397 [inline] filemap_fdatawrite_wbc+0x148/0x1c0 mm/filemap.c:387 __filemap_fdatawrite_range+0xba/0x100 mm/filemap.c:430 filemap_write_and_wait_range mm/filemap.c:685 [inline] filemap_write_and_wait_range+0xa3/0x130 mm/filemap.c:676 bch2_symlink+0x13a/0x200 fs/bcachefs/fs.c:587 vfs_symlink fs/namei.c:4481 [inline] vfs_symlink+0x3e8/0x630 fs/namei.c:4465 do_symlinkat+0x263/0x310 fs/namei.c:4507 __do_sys_symlinkat fs/namei.c:4523 [inline] __se_sys_symlinkat fs/namei.c:4520 [inline] __x64_sys_symlinkat+0x97/0xc0 fs/namei.c:4520 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802814bc00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 127 bytes inside of allocated 128-byte region [ffff88802814bc00, ffff88802814bc80) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2814b ksm flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff8880150418c0 ffffea0001ed91c0 dead000000000003 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1228314669 (swapper/0), ts 1, free_ts 17946114541 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2180 [inline] allocate_slab mm/slub.c:2343 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2396 ___slab_alloc+0x66d/0x1790 mm/slub.c:3530 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3615 __slab_alloc_node mm/slub.c:3668 [inline] slab_alloc_node mm/slub.c:3841 [inline] kmalloc_trace+0x306/0x340 mm/slub.c:3998 kmalloc include/linux/slab.h:628 [inline] __hw_addr_create net/core/dev_addr_lists.c:60 [inline] __hw_addr_add_ex+0x3c8/0x7c0 net/core/dev_addr_lists.c:118 __dev_mc_add net/core/dev_addr_lists.c:867 [inline] dev_mc_add+0xb6/0x110 net/core/dev_addr_lists.c:885 igmp6_group_added+0x395/0x480 net/ipv6/mcast.c:680 __ipv6_dev_mc_inc+0x72a/0xc50 net/ipv6/mcast.c:949 ipv6_add_dev+0xa64/0x1400 net/ipv6/addrconf.c:470 addrconf_notify+0x546/0x19e0 net/ipv6/addrconf.c:3651 call_netdevice_notifier net/core/dev.c:1644 [inline] call_netdevice_register_notifiers net/core/dev.c:1652 [inline] call_netdevice_register_net_notifiers+0xe7/0x2d0 net/core/dev.c:1682 register_netdevice_notifier+0xf9/0x280 net/core/dev.c:1733 addrconf_init+0xe7/0x360 net/ipv6/addrconf.c:7438 page last free pid 8 tgid 8 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 vfree+0x181/0x7a0 mm/vmalloc.c:3340 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:3261 process_one_work+0x9a9/0x1ac0 kernel/workqueue.c:3267 process_scheduled_works kernel/workqueue.c:3348 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3429 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88802814bb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802814bc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802814bc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802814bd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc ffff88802814bd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================