================================================================== 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 ffff888011adc882 by task syz-executor.2/5749 CPU: 0 PID: 5749 Comm: syz-executor.2 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+0x35b/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+0x139/0x2a0 fs/namei.c:4481 do_symlinkat+0x222/0x3a0 fs/namei.c:4507 __do_sys_symlink fs/namei.c:4528 [inline] __se_sys_symlink fs/namei.c:4526 [inline] __x64_sys_symlink+0x7e/0x90 fs/namei.c:4526 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:0x7fed6ae7dd69 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:00007fed6bcd30c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 00007fed6afabf80 RCX: 00007fed6ae7dd69 RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000020000580 RBP: 00007fed6aeca49e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fed6afabf80 R15: 00007ffddc12fc58 Allocated by task 5749: 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+0x35b/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+0x139/0x2a0 fs/namei.c:4481 do_symlinkat+0x222/0x3a0 fs/namei.c:4507 __do_sys_symlink fs/namei.c:4528 [inline] __se_sys_symlink fs/namei.c:4526 [inline] __x64_sys_symlink+0x7e/0x90 fs/namei.c:4526 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 ffff888011adc800 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 2 bytes to the right of allocated 128-byte region [ffff888011adc800, ffff888011adc880) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11adc flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff8880150418c0 dead000000000100 dead000000000122 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 2885, tgid -1758522216 (kworker/u8:8), ts 2885, free_ts 79836981164 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] kmalloc_trace+0x269/0x370 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+0x1a8/0x610 net/core/dev_addr_lists.c:118 __dev_mc_add net/core/dev_addr_lists.c:867 [inline] dev_mc_add+0xa3/0x110 net/core/dev_addr_lists.c:885 igmp6_group_added+0x1a4/0x710 net/ipv6/mcast.c:680 __ipv6_dev_mc_inc+0x8b8/0xa90 net/ipv6/mcast.c:949 addrconf_join_solict net/ipv6/addrconf.c:2239 [inline] addrconf_dad_begin net/ipv6/addrconf.c:4100 [inline] addrconf_dad_work+0x448/0x16f0 net/ipv6/addrconf.c:4225 process_one_work kernel/workqueue.c:3267 [inline] process_scheduled_works+0xa12/0x17c0 kernel/workqueue.c:3348 worker_thread+0x86d/0xd70 kernel/workqueue.c:3429 kthread+0x2f2/0x390 kernel/kthread.c:388 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 page last free pid 5104 tgid 5104 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+0x986/0xab0 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] kmem_cache_alloc_node+0x194/0x390 mm/slub.c:3894 __alloc_skb+0x1c3/0x440 net/core/skbuff.c:658 alloc_skb include/linux/skbuff.h:1313 [inline] nlmsg_new include/net/netlink.h:1010 [inline] rtmsg_ifa+0x1f0/0x3b0 net/ipv4/devinet.c:1924 __inet_insert_ifa+0x9c0/0xc30 net/ipv4/devinet.c:555 inet_rtm_newaddr+0xbda/0x1af0 net/ipv4/devinet.c:981 rtnetlink_rcv_msg+0x89d/0x10d0 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1e5/0x430 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ec/0x980 net/netlink/af_netlink.c:1361 Memory state around the buggy address: ffff888011adc780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888011adc800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888011adc880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888011adc900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888011adc980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================