[v5.15] KASAN: use-after-free Read in __ocfs2_flush_truncate_log

3 views
Skip to first unread message

syzbot

unread,
May 25, 2025, 7:09:48 AM5/25/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 98f47d0e9b8c Linux 5.15.184
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15501170580000
kernel config: https://syzkaller.appspot.com/x/.config?x=9eb2b5a65dfc4761
dashboard link: https://syzkaller.appspot.com/bug?extid=53be1be98c6397911454
compiler: Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=168edad4580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15bb35f4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d2845fb3af6c/disk-98f47d0e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1f12b743be24/vmlinux-98f47d0e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8f178b57ea38/Image-98f47d0e.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/cd2166a4bb09/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=11501170580000)

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

=======================================================
ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode.
==================================================================
BUG: KASAN: use-after-free in ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5959 [inline]
BUG: KASAN: use-after-free in __ocfs2_flush_truncate_log+0x64c/0xf30 fs/ocfs2/alloc.c:6053
Read of size 4 at addr ffff0000e2af7ab8 by task syz-executor132/4023

CPU: 1 PID: 4023 Comm: syz-executor132 Not tainted 5.15.184-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call trace:
dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
print_address_description+0x78/0x30c mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xec/0x15c mm/kasan/report.c:451
__asan_report_load4_noabort+0x44/0x50 mm/kasan/report_generic.c:308
ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5959 [inline]
__ocfs2_flush_truncate_log+0x64c/0xf30 fs/ocfs2/alloc.c:6053
ocfs2_flush_truncate_log+0x48/0x68 fs/ocfs2/alloc.c:6075
ocfs2_sync_fs+0xf8/0x2a4 fs/ocfs2/super.c:403
sync_filesystem+0x1a0/0x218 fs/sync.c:66
generic_shutdown_super+0x70/0x2f0 fs/super.c:448
kill_block_super+0x70/0xdc fs/super.c:1427
deactivate_locked_super+0xb8/0x13c fs/super.c:335
deactivate_super+0xf8/0x118 fs/super.c:366
cleanup_mnt+0x3a4/0x458 fs/namespace.c:1143
__cleanup_mnt+0x20/0x30 fs/namespace.c:1150
task_work_run+0x12c/0x1e0 kernel/task_work.c:188
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0x67c/0x1f58 kernel/exit.c:874
do_group_exit+0x100/0x268 kernel/exit.c:996
__do_sys_exit_group kernel/exit.c:1007 [inline]
__se_sys_exit_group kernel/exit.c:1005 [inline]
__wake_up_parent+0x0/0x60 kernel/exit.c:1005
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the page:
page:00000000c0228cea refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x122af7
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc00038abdc8 fffffc00038abdc8 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000e2af7980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000e2af7a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff0000e2af7a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff0000e2af7b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000e2af7b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
------------[ cut here ]------------
kernel BUG at fs/ocfs2/suballoc.c:2469!
Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 4023 Comm: syz-executor132 Tainted: G B 5.15.184-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : _ocfs2_free_suballoc_bits+0xc50/0xf70 fs/ocfs2/suballoc.c:2469
lr : _ocfs2_free_suballoc_bits+0xc50/0xf70 fs/ocfs2/suballoc.c:2469
sp : ffff80001cfb73c0
x29: ffff80001cfb7520 x28: 00000000fb11ff4a x27: dfff800000000000
x26: ffff0000e3153478 x25: ffff800009cdfafc x24: ffff0000e2a74e00
x23: ffff7000039f6e88 x22: 0000000000000e00 x21: 0000000000000e00
x20: 000000000f90c000 x19: 00000000fb1203e1 x18: 0000000000000000
x17: 0000000000000000 x16: ffff8000111a5644 x15: 00000000fffffffc
x14: 0000000000ff0100 x13: ffffffffffffffff x12: 0000000000ff0100
x11: 0000000000000000 x10: 0000000000000000 x9 : ffff800009ce5208
x8 : ffff0000d79cb680 x7 : 0000000000000000 x6 : ffff800009cdfafc
x5 : 00000000fb11ff4a x4 : 000000000f90c000 x3 : 0000000000000497
x2 : ffff0000dd3cb0e8 x1 : 0000000000000e00 x0 : 00000000fb1203e1
Call trace:
_ocfs2_free_suballoc_bits+0xc50/0xf70 fs/ocfs2/suballoc.c:2469
_ocfs2_free_clusters+0x510/0x9b0 fs/ocfs2/suballoc.c:2569
ocfs2_free_clusters+0x50/0x68 fs/ocfs2/suballoc.c:2590
ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5971 [inline]
__ocfs2_flush_truncate_log+0x5b0/0xf30 fs/ocfs2/alloc.c:6053
ocfs2_flush_truncate_log+0x48/0x68 fs/ocfs2/alloc.c:6075
ocfs2_sync_fs+0xf8/0x2a4 fs/ocfs2/super.c:403
sync_filesystem+0x1a0/0x218 fs/sync.c:66
generic_shutdown_super+0x70/0x2f0 fs/super.c:448
kill_block_super+0x70/0xdc fs/super.c:1427
deactivate_locked_super+0xb8/0x13c fs/super.c:335
deactivate_super+0xf8/0x118 fs/super.c:366
cleanup_mnt+0x3a4/0x458 fs/namespace.c:1143
__cleanup_mnt+0x20/0x30 fs/namespace.c:1150
task_work_run+0x12c/0x1e0 kernel/task_work.c:188
exit_task_work include/linux/task_work.h:33 [inline]
do_exit+0x67c/0x1f58 kernel/exit.c:874
do_group_exit+0x100/0x268 kernel/exit.c:996
__do_sys_exit_group kernel/exit.c:1007 [inline]
__se_sys_exit_group kernel/exit.c:1005 [inline]
__wake_up_parent+0x0/0x60 kernel/exit.c:1005
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
Code: 17fffec8 979e4dc1 d4210000 979e4dbf (d4210000)
---[ end trace 4327436f4ad1c157 ]---


---
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
Reply all
Reply to author
Forward
0 new messages