loop0: detected capacity change from 0 to 32768 bcachefs (loop0): mounting version 1.7: (unknown version) opts=metadata_checksum=none,data_checksum=none,nojournal_transaction_names bcachefs (loop0): recovering from clean shutdown, journal seq 10 ================================================================== BUG: KASAN: slab-out-of-bounds in poly1305_update_arch+0x1a2/0x840 arch/x86/crypto/poly1305_glue.c:198 Read of size 8 at addr ffff88816b441790 by task syz-executor.0/2388 CPU: 1 PID: 2388 Comm: syz-executor.0 Not tainted 6.6.0-rc1-syzkaller #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+0xf8/0x260 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x167/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 kasan_check_range+0x282/0x290 mm/kasan/generic.c:187 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 poly1305_update_arch+0x1a2/0x840 arch/x86/crypto/poly1305_glue.c:198 crypto_poly1305_update+0xd/0x20 arch/x86/crypto/poly1305_glue.c:230 crypto_shash_update+0x220/0x2a0 crypto/shash.c:134 bch2_checksum+0x3aa/0x700 fs/bcachefs/checksum.c:228 bch2_btree_node_read_done+0xb51/0x4a10 fs/bcachefs/btree_io.c:989 btree_node_read_work+0x602/0x1250 fs/bcachefs/btree_io.c:1194 bch2_btree_node_read+0x1dc7/0x2ae0 fs/bcachefs/btree_io.c:1568 __bch2_btree_root_read fs/bcachefs/btree_io.c:1607 [inline] bch2_btree_root_read+0x2fc/0x7e0 fs/bcachefs/btree_io.c:1631 read_btree_roots+0x281/0x4d0 fs/bcachefs/recovery.c:375 bch2_fs_recovery+0x2d0d/0x4420 fs/bcachefs/recovery.c:808 bch2_fs_start+0x76a/0x9a0 fs/bcachefs/super.c:961 bch2_fs_open+0x207d/0x2bb0 fs/bcachefs/super.c:1948 bch2_mount+0x564/0x1120 fs/bcachefs/fs.c:1829 legacy_get_tree+0xe9/0x180 fs/fs_context.c:638 vfs_get_tree+0x82/0x190 fs/super.c:1750 do_new_mount+0x1e5/0x930 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x242/0x2e0 fs/namespace.c:3861 do_syscall_64+0x46/0xc0 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 RIP: 0033:0x7f46ef67f3aa Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f46f03dfef8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f46f03dff80 RCX: 00007f46ef67f3aa RDX: 0000000020011a00 RSI: 0000000020011a40 RDI: 00007f46f03dff40 RBP: 0000000020011a00 R08: 00007f46f03dff80 R09: 0000000001200014 R10: 0000000001200014 R11: 0000000000000246 R12: 0000000020011a40 R13: 00007f46f03dff40 R14: 00000000000119f9 R15: 0000000020000100 Allocated by task 2132: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x80 mm/kasan/common.c:52 __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x67/0x3d0 mm/slab.h:762 slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x11f/0x2a0 mm/slub.c:3502 kmem_cache_zalloc include/linux/slab.h:710 [inline] lsm_file_alloc security/security.c:612 [inline] security_file_alloc+0x23/0x100 security/security.c:2603 init_file+0x87/0x1e0 fs/file_table.c:161 alloc_empty_file+0x7f/0x160 fs/file_table.c:210 path_openat+0xff/0x2760 fs/namei.c:3782 do_filp_open+0x22a/0x440 fs/namei.c:3823 do_sys_openat2+0xf6/0x180 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x20d/0x260 fs/open.c:1448 do_syscall_64+0x46/0xc0 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 Freed by task 2132: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0x122/0x1f0 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] kmem_cache_free+0x2ba/0x4f0 mm/slub.c:3831 file_free fs/file_table.c:77 [inline] __fput+0x4a3/0x6f0 fs/file_table.c:397 task_work_run+0x20e/0x280 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xa4/0xc0 kernel/entry/common.c:171 exit_to_user_mode_prepare+0x64/0xb0 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x2c/0x1e0 kernel/entry/common.c:296 do_syscall_64+0x55/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 The buggy address belongs to the object at ffff88816b441780 which belongs to the cache lsm_file_cache of size 16 The buggy address is located 0 bytes to the right of allocated 16-byte region [ffff88816b441780, ffff88816b441790) The buggy address belongs to the physical page: page:ffffea0005ad1040 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x16b441 anon flags: 0x100000000000800(slab|node=0|zone=2) page_type: 0xffffffff() raw: 0100000000000800 ffff888101a63280 0000000000000000 0000000000000001 raw: 0000000000000000 0000000000800080 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1742, tgid 1742 (modprobe), ts 28104901894, free_ts 28084913327 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x10f/0x130 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x3baa/0x3db0 mm/page_alloc.c:3170 __alloc_pages+0x255/0x650 mm/page_alloc.c:4426 alloc_slab_page+0x6a/0x170 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x70/0x270 mm/slub.c:2070 ___slab_alloc+0x834/0xd60 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x1a6/0x2a0 mm/slub.c:3502 kmem_cache_zalloc include/linux/slab.h:710 [inline] lsm_file_alloc security/security.c:612 [inline] security_file_alloc+0x23/0x100 security/security.c:2603 init_file+0x87/0x1e0 fs/file_table.c:161 alloc_empty_file+0x7f/0x160 fs/file_table.c:210 path_openat+0xff/0x2760 fs/namei.c:3782 do_filp_open+0x22a/0x440 fs/namei.c:3823 do_sys_openat2+0xf6/0x180 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x20d/0x260 fs/open.c:1448 do_syscall_64+0x46/0xc0 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x7bd/0x8e0 mm/page_alloc.c:2312 free_unref_page+0x37/0x3c0 mm/page_alloc.c:2405 tlb_batch_list_free mm/mmu_gather.c:114 [inline] tlb_finish_mmu+0x13f/0x1c0 mm/mmu_gather.c:395 exit_mmap+0x411/0x970 mm/mmap.c:3223 __mmput+0x9b/0x2d0 kernel/fork.c:1349 exit_mm+0x113/0x1b0 kernel/exit.c:567 do_exit+0x7c7/0x2350 kernel/exit.c:861 do_group_exit+0x1b9/0x280 kernel/exit.c:1024 __do_sys_exit_group kernel/exit.c:1035 [inline] __se_sys_exit_group kernel/exit.c:1033 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1033 do_syscall_64+0x46/0xc0 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 Memory state around the buggy address: ffff88816b441680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ffff88816b441700: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc >ffff88816b441780: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ^ ffff88816b441800: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ffff88816b441880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ==================================================================