bcachefs (loop3): mounting version 1.7: mi_btree_bitmap opts=metadata_checksum=none,data_checksum=xxhash,compression=zstd,nojournal_transaction_names bcachefs (loop3): recovering from clean shutdown, journal seq 10 ================================================================== BUG: KASAN: use-after-free in memcpy_dir crypto/scatterwalk.c:23 [inline] BUG: KASAN: use-after-free in scatterwalk_copychunks+0x1dc/0x44c crypto/scatterwalk.c:38 Read of size 288 at addr ffff0000f6de0000 by task syz-executor.3/7008 CPU: 1 PID: 7008 Comm: syz-executor.3 Tainted: G W 6.10.0-rc3-syzkaller-gac2193b4b460 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/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+0x14a4/0x4ac8 fs/bcachefs/btree_io.c:1088 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:475 bch2_fs_recovery+0x31c4/0x5488 fs/bcachefs/recovery.c:803 bch2_fs_start+0x30c/0x53c fs/bcachefs/super.c:1031 bch2_fs_open+0x8b4/0xb64 fs/bcachefs/super.c:2123 bch2_mount+0x4fc/0xe18 fs/bcachefs/fs.c:1917 legacy_get_tree+0xd4/0x16c fs/fs_context.c:662 vfs_get_tree+0x90/0x288 fs/super.c:1780 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+0x45c/0x594 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:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 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 physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff0000f6de7800 pfn:0x136de0 flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffff7f(buddy) raw: 05ffc00000000000 ffff0001fea88cc8 ffff0001fea88cc8 0000000000000000 raw: ffff0000f6de7800 0000000000000005 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f6ddff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff0000f6ddff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff0000f6de0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff0000f6de0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff0000f6de0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== bcachefs (loop3): inconsistency detected - emergency read only at journal seq 10 bcachefs (loop3): flagging btree backpointers lost data error reading btree root backpointers l=0: btree_node_read_error, shutting down bcachefs (loop3): bch2_fs_recovery(): error fsck_errors_not_fixed bcachefs (loop3): bch2_fs_start(): e