bcachefs (loop3): recovering from clean shutdown, journal seq 10 ================================================================== BUG: KASAN: slab-use-after-free in memcpy_dir crypto/scatterwalk.c:23 [inline] BUG: KASAN: slab-use-after-free in scatterwalk_copychunks+0x1dc/0x44c crypto/scatterwalk.c:38 Read of size 296 at addr ffff0000ee920000 by task syz.3.4/6388 CPU: 1 PID: 6388 Comm: syz.3.4 Not tainted 6.10.0-rc7-syzkaller-gc912bf709078 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x198/0x538 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 kasan_check_range+0x268/0x2a8 mm/kasan/generic.c:189 __asan_memcpy+0x3c/0x84 mm/kasan/shadow.c:105 memcpy_dir crypto/scatterwalk.c:23 [inline] scatterwalk_copychunks+0x1dc/0x44c crypto/scatterwalk.c:38 skcipher_next_slow+0x210/0x3cc crypto/skcipher.c:276 skcipher_walk_next+0x548/0x9e0 crypto/skcipher.c:361 skcipher_walk_done+0x5e4/0x9d8 crypto/skcipher.c:157 chacha_neon_stream_xor+0x55c/0xc14 arch/arm64/crypto/chacha-neon-glue.c:132 chacha_neon+0x60/0x70 arch/arm64/crypto/chacha-neon-glue.c:143 crypto_skcipher_encrypt+0xfc/0x124 crypto/skcipher.c:643 do_encrypt_sg fs/bcachefs/checksum.c:108 [inline] do_encrypt+0x43c/0x6a0 fs/bcachefs/checksum.c:128 bch2_encrypt+0x8c/0xb0 fs/bcachefs/checksum.c:246 bset_encrypt fs/bcachefs/btree_io.h:118 [inline] bch2_btree_node_read_done+0x1064/0x4ac8 fs/bcachefs/btree_io.c:1129 btree_node_read_work+0x50c/0xe04 fs/bcachefs/btree_io.c:1345 bch2_btree_node_read+0x1f50/0x280c fs/bcachefs/btree_io.c:1730 __bch2_btree_root_read fs/bcachefs/btree_io.c:1769 [inline] bch2_btree_root_read+0x2a8/0x534 fs/bcachefs/btree_io.c:1793 read_btree_roots+0x21c/0x730 fs/bcachefs/recovery.c:481 bch2_fs_recovery+0x31c8/0x5488 fs/bcachefs/recovery.c:809 bch2_fs_start+0x30c/0x53c fs/bcachefs/super.c:1035 bch2_fs_open+0x8b4/0xb64 fs/bcachefs/super.c:2132 bch2_mount+0x4fc/0xe68 fs/bcachefs/fs.c:1926 legacy_get_tree+0xd4/0x16c fs/fs_context.c:662 vfs_get_tree+0x90/0x288 fs/super.c:1789 do_new_mount+0x278/0x900 fs/namespace.c:3352 path_mount+0x590/0xe04 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __arm64_sys_mount+0x3c4/0x488 fs/namespace.c:3875 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:131 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:150 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Allocated by task 5902: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace_noprof+0x244/0x374 mm/slub.c:4154 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] uevent_show+0x164/0x33c drivers/base/core.c:2738 dev_attr_show+0x60/0xcc drivers/base/core.c:2437 sysfs_kf_seq_show+0x2d0/0x43c fs/sysfs/file.c:59 kernfs_seq_show+0x150/0x1fc fs/kernfs/file.c:205 seq_read_iter+0x3e0/0xc44 fs/seq_file.c:230 kernfs_fop_read_iter+0x144/0x5c8 fs/kernfs/file.c:279 new_sync_read fs/read_write.c:395 [inline] vfs_read+0x6a8/0x8b4 fs/read_write.c:476 ksys_read+0x15c/0x26c fs/read_write.c:619 __do_sys_read fs/read_write.c:629 [inline] __se_sys_read fs/read_write.c:627 [inline] __arm64_sys_read+0x7c/0x90 fs/read_write.c:627 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:131 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:150 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Freed by task 5902: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:579 poison_slab_object+0x128/0x180 mm/kasan/common.c:240 __kasan_slab_free+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2196 [inline] slab_free mm/slub.c:4438 [inline] kfree+0x154/0x3e0 mm/slub.c:4559 uevent_show+0x1e4/0x33c drivers/base/core.c:2754 dev_attr_show+0x60/0xcc drivers/base/core.c:2437 sysfs_kf_seq_show+0x2d0/0x43c fs/sysfs/file.c:59 kernfs_seq_show+0x150/0x1fc fs/kernfs/file.c:205 seq_read_iter+0x3e0/0xc44 fs/seq_file.c:230 kernfs_fop_read_iter+0x144/0x5c8 fs/kernfs/file.c:279 new_sync_read fs/read_write.c:395 [inline] vfs_read+0x6a8/0x8b4 fs/read_write.c:476 ksys_read+0x15c/0x26c fs/read_write.c:619 __do_sys_read fs/read_write.c:629 [inline] __se_sys_read fs/read_write.c:627 [inline] __arm64_sys_read+0x7c/0x90 fs/read_write.c:627 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:131 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:150 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff0000ee920000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 0 bytes inside of freed 4096-byte region [ffff0000ee920000, ffff0000ee921000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12e920 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 05ffc00000000040 ffff0000c0002140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000001ffffefff 0000000000000000 head: 05ffc00000000040 ffff0000c0002140 dead000000000122 0000000000000000 head: 0000000000000000 0000000000040004 00000001ffffefff 0000000000000000 head: 05ffc00000000003 fffffdffc3ba4801 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000ee91ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000ee91ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000ee920000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000ee920080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ee920100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== bcachefs (loop3): flagging btree freespace lost data error reading btree root freespace l=0: btree_node_read_error, shutting down bcachefs (loop3): inconsistency detected - emergency read only at journal seq 10 bcachefs (loop3): bch2_fs_recovery(): error fsck_errors_not_fixed bcachefs (loop3): bch2_fs_start(): error starting filesystem fsck_errors_not_fixed bcachefs (loop3): shutting down bcachefs (loop3): shutdown complete Unable to handle kernel paging request at virtual address d2ebd6355d156985 Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [d2ebd6355d156985] address between user and kernel address ranges