[syzbot] [bcache?] [ext4?] KASAN: use-after-free Read in register_bcache

4 views
Skip to first unread message

syzbot

unread,
Aug 9, 2026, 3:12:46 PM (6 days ago) Aug 9
to col...@fnnas.com, col...@fygo.io, kent.ov...@linux.dev, linux-...@vger.kernel.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ba5cc80fd326 Merge branch 'for-next/core' into for-kernelci
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=17767fb9580000
kernel config: https://syzkaller.appspot.com/x/.config?x=ccf4bea59f67007
dashboard link: https://syzkaller.appspot.com/bug?extid=cb5b32abe226710cdd8a
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10f67fb9580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14cd8149580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/959ad5f4e730/disk-ba5cc80f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0787d25f251e/vmlinux-ba5cc80f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2e85c36fabac/Image-ba5cc80f.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/130fa1cc1a68/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=111f8079580000)

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+cb5b32...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in crc64_be_generic lib/crc/crc64-main.c:47 [inline]
BUG: KASAN: use-after-free in crc64_be+0xb8/0xe8 lib/crc/crc64-main.c:68
Read of size 1 at addr ffff0000dd543000 by task syz.0.33/4986

CPU: 1 UID: 0 PID: 4986 Comm: syz.0.33 Not tainted syzkaller #0 PREEMPT
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/02/2026
Call trace:
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C)
__dump_stack+0x30/0x40 lib/dump_stack.c:94
dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120
print_address_description+0xb0/0x238 mm/kasan/report.c:378
print_report+0x68/0x84 mm/kasan/report.c:482
kasan_report+0x8c/0xc4 mm/kasan/report.c:595
__asan_report_load1_noabort+0x20/0x2c mm/kasan/report_generic.c:378
crc64_be_generic lib/crc/crc64-main.c:47 [inline]
crc64_be+0xb8/0xe8 lib/crc/crc64-main.c:68
bch_crc64 drivers/md/bcache/util.h:529 [inline]
read_super drivers/md/bcache/super.c:208 [inline]
register_bcache+0x9a4/0x13d8 drivers/md/bcache/super.c:2601
kobj_attr_store+0x6c/0x90 lib/kobject.c:840
sysfs_kf_write+0xe0/0x108 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x260/0x3b8 fs/kernfs/file.c:345
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x51c/0xa0c fs/read_write.c:687
ksys_write+0x12c/0x228 fs/read_write.c:739
__do_sys_write fs/read_write.c:750 [inline]
__se_sys_write fs/read_write.c:747 [inline]
__arm64_sys_write+0x84/0x98 fs/read_write.c:747
__invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
invoke_syscall+0x98/0x244 arch/arm64/kernel/syscall.c:49
el0_svc_common+0xec/0x23c arch/arm64/kernel/syscall.c:121
do_el0_svc+0x4c/0x5c arch/arm64/kernel/syscall.c:140
el0_svc+0x64/0x260 arch/arm64/kernel/entry-common.c:738
el0t_64_sync_handler+0x48/0x148 arch/arm64/kernel/entry-common.c:757
el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:590

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff0000dd543af0 pfn:0x11d543
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffdffc3754688 fffffdffc3755348 0000000000000000
raw: ffff0000dd543af0 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000dd542f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff0000dd542f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0000dd543000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff0000dd543080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000dd543100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
bcache: register_bcache() error : Bad checksum


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
3:43 AM (9 hours ago) 3:43 AM
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: [PATCH] check keys size before checksum calculation
Author: subasr...@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git ba5cc80fd32665ed609037ff30ede8d194f24aab

Signed-off-by: Subasri S <subasr...@gmail.com>
---
drivers/md/bcache/super.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 97d9adb0bf96..49b3a2231820 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -204,6 +204,11 @@ static const char *read_super(struct cache_sb *sb, struct block_device *bdev,
if (memcmp(sb->magic, bcache_magic, 16))
goto err;

+
+ err = "Too many journal buckets";
+ if (sb->keys > SB_JOURNAL_BUCKETS)
+ goto err;
+
err = "Bad checksum";
if (s->csum != csum_set(s))
goto err;
--
2.43.0

syzbot

unread,
6:24 AM (6 hours ago) 6:24 AM
to linux-...@vger.kernel.org, subasr...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+cb5b32...@syzkaller.appspotmail.com
Tested-by: syzbot+cb5b32...@syzkaller.appspotmail.com

Tested on:

commit: ba5cc80f Merge branch 'for-next/core' into for-kernelci
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=15013279580000
kernel config: https://syzkaller.appspot.com/x/.config?x=ccf4bea59f67007
dashboard link: https://syzkaller.appspot.com/bug?extid=cb5b32abe226710cdd8a
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=1301a949580000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages