================================================================== 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+0x149/0x180 fs/bcachefs/varint.c:114 Read of size 8 at addr ffff888060e76286 by task syz-executor.0/10986 CPU: 1 PID: 10986 Comm: syz-executor.0 Not tainted 6.9.0-rc7-syzkaller-00023-g6d7ddd805123 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 get_unaligned_le64 include/asm-generic/unaligned.h:37 [inline] bch2_varint_decode_fast+0x149/0x180 fs/bcachefs/varint.c:114 bch2_inode_unpack_v3 fs/bcachefs/inode.c:270 [inline] bch2_inode_unpack+0x7d2/0x2960 fs/bcachefs/inode.c:323 __bch2_inode_invalid+0x14e/0x5a0 fs/bcachefs/inode.c:449 __bch2_trans_commit+0x90d/0x8560 fs/bcachefs/btree_trans_commit.c:1008 bch2_trans_commit fs/bcachefs/btree_update.h:168 [inline] bch2_extent_update+0x4c0/0xbb0 fs/bcachefs/io_write.c:318 bch2_write_index_default fs/bcachefs/io_write.c:366 [inline] __bch2_write_index+0xee9/0x2190 fs/bcachefs/io_write.c:520 bch2_write_data_inline fs/bcachefs/io_write.c:1538 [inline] bch2_write+0xf28/0x1590 fs/bcachefs/io_write.c:1606 closure_queue include/linux/closure.h:257 [inline] closure_call include/linux/closure.h:390 [inline] bch2_writepage_do_io fs/bcachefs/fs-io-buffered.c:468 [inline] bch2_writepages+0x27d/0x380 fs/bcachefs/fs-io-buffered.c:660 do_writepages+0x359/0x870 mm/page-writeback.c:2612 filemap_fdatawrite_wbc+0x125/0x180 mm/filemap.c:397 __filemap_fdatawrite_range mm/filemap.c:430 [inline] filemap_write_and_wait_range+0x198/0x290 mm/filemap.c:685 bch2_symlink+0x1d8/0x2e0 fs/bcachefs/fs.c:587 vfs_symlink+0x137/0x2a0 fs/namei.c:4481 do_symlinkat+0x222/0x3a0 fs/namei.c:4507 __do_sys_symlinkat fs/namei.c:4523 [inline] __se_sys_symlinkat fs/namei.c:4520 [inline] __x64_sys_symlinkat+0x99/0xb0 fs/namei.c:4520 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9b7c67dd69 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:00007f9b7d3ee0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000010a RAX: ffffffffffffffda RBX: 00007f9b7c7abf80 RCX: 00007f9b7c67dd69 RDX: 00000000200000c0 RSI: 0000000000000006 RDI: 0000000020000040 RBP: 00007f9b7c6ca49e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f9b7c7abf80 R15: 00007ffff8ee9e88 Allocated by task 10986: 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:370 [inline] __kasan_kmalloc+0x98/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+0x24e/0x4f0 mm/slub.c:3992 __do_krealloc mm/slab_common.c:1192 [inline] krealloc+0x7d/0x120 mm/slab_common.c:1225 __bch2_trans_kmalloc+0x202/0xb50 fs/bcachefs/btree_iter.c:2831 bch2_trans_kmalloc_nomemzero fs/bcachefs/btree_iter.h:537 [inline] __bch2_bkey_make_mut_noupdate fs/bcachefs/btree_update.h:223 [inline] __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+0xdc2/0x1310 fs/bcachefs/io_write.c:219 bch2_extent_update+0x40a/0xbb0 fs/bcachefs/io_write.c:314 bch2_write_index_default fs/bcachefs/io_write.c:366 [inline] __bch2_write_index+0xee9/0x2190 fs/bcachefs/io_write.c:520 bch2_write_data_inline fs/bcachefs/io_write.c:1538 [inline] bch2_write+0xf28/0x1590 fs/bcachefs/io_write.c:1606 closure_queue include/linux/closure.h:257 [inline] closure_call include/linux/closure.h:390 [inline] bch2_writepage_do_io fs/bcachefs/fs-io-buffered.c:468 [inline] bch2_writepages+0x27d/0x380 fs/bcachefs/fs-io-buffered.c:660 do_writepages+0x359/0x870 mm/page-writeback.c:2612 filemap_fdatawrite_wbc+0x125/0x180 mm/filemap.c:397 __filemap_fdatawrite_range mm/filemap.c:430 [inline] filemap_write_and_wait_range+0x198/0x290 mm/filemap.c:685 bch2_symlink+0x1d8/0x2e0 fs/bcachefs/fs.c:587 vfs_symlink+0x137/0x2a0 fs/namei.c:4481 do_symlinkat+0x222/0x3a0 fs/namei.c:4507 __do_sys_symlinkat fs/namei.c:4523 [inline] __se_sys_symlinkat fs/namei.c:4520 [inline] __x64_sys_symlinkat+0x99/0xb0 fs/namei.c:4520 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888060e76200 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 6 bytes to the right of allocated 128-byte region [ffff888060e76200, ffff888060e76280) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x60e76 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff8880150418c0 ffffea0000895740 dead000000000004 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 6543, tgid -1016940509 (syz-executor.1), ts 6543, free_ts 153600447888 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3410/0x35b0 mm/page_alloc.c:3317 __alloc_pages+0x256/0x6c0 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+0x5f/0x160 mm/slub.c:2180 allocate_slab mm/slub.c:2343 [inline] new_slab+0x84/0x2f0 mm/slub.c:2396 ___slab_alloc+0xc73/0x1260 mm/slub.c:3530 __slab_alloc mm/slub.c:3615 [inline] __slab_alloc_node mm/slub.c:3668 [inline] slab_alloc_node mm/slub.c:3841 [inline] __do_kmalloc_node mm/slub.c:3971 [inline] __kmalloc_node+0x2db/0x4f0 mm/slub.c:3979 kmalloc_array_node include/linux/slab.h:726 [inline] kcalloc_node include/linux/slab.h:731 [inline] memcg_alloc_slab_cgroups+0x81/0x120 mm/memcontrol.c:3015 account_slab mm/slub.c:2306 [inline] allocate_slab mm/slub.c:2361 [inline] new_slab+0xc0/0x2f0 mm/slub.c:2396 ___slab_alloc+0xc73/0x1260 mm/slub.c:3530 __slab_alloc mm/slub.c:3615 [inline] __slab_alloc_node mm/slub.c:3668 [inline] slab_alloc_node mm/slub.c:3841 [inline] __do_kmalloc_node mm/slub.c:3971 [inline] __kmalloc+0x2e5/0x4a0 mm/slub.c:3985 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] __register_sysctl_table+0x67/0x1440 fs/proc/proc_sysctl.c:1360 mpls_dev_sysctl_register+0x203/0x2f0 net/mpls/af_mpls.c:1422 mpls_add_dev net/mpls/af_mpls.c:1478 [inline] mpls_dev_notify+0x33f/0x7a0 net/mpls/af_mpls.c:1618 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] register_netdevice+0x15b2/0x1a20 net/core/dev.c:10316 page last free pid 6543 tgid 6543 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+0x97b/0xaa0 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 discard_slab mm/slub.c:2442 [inline] __put_partials+0xeb/0x130 mm/slub.c:2911 put_cpu_partial+0x17c/0x250 mm/slub.c:2986 __slab_free+0x2ea/0x3d0 mm/slub.c:4157 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x5e/0xc0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3804 [inline] slab_alloc_node mm/slub.c:3851 [inline] __do_kmalloc_node mm/slub.c:3971 [inline] __kmalloc_node_track_caller+0x1fd/0x4f0 mm/slub.c:3992 kmemdup+0x2a/0x60 mm/util.c:131 __addrconf_sysctl_register+0xb1/0x3f0 net/ipv6/addrconf.c:7198 addrconf_sysctl_register+0x167/0x1c0 net/ipv6/addrconf.c:7264 ipv6_add_dev+0xcff/0x1220 net/ipv6/addrconf.c:455 addrconf_notify+0x6a7/0x1020 net/ipv6/addrconf.c:3651 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] register_netdevice+0x15b2/0x1a20 net/core/dev.c:10316 Memory state around the buggy address: ffff888060e76180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888060e76200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888060e76280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888060e76300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888060e76380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================