[v6.1] KASAN: null-ptr-deref Write in f2fs_issue_flush

1 view
Skip to first unread message

syzbot

unread,
Sep 30, 2025, 9:02:33 PM (2 days ago) Sep 30
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7b34dc04e4ff Linux 6.1.154
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1359c214580000
kernel config: https://syzkaller.appspot.com/x/.config?x=68aa5a3af1cb953a
dashboard link: https://syzkaller.appspot.com/bug?extid=1f2ac055dbc0980c23b3
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e71c87e0f2ec/disk-7b34dc04.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/6b873083d403/vmlinux-7b34dc04.xz
kernel image: https://storage.googleapis.com/syzbot-assets/83659dda663d/Image-7b34dc04.gz.xz

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

F2FS-fs (loop4): Try to recover all the superblocks, ret: 0
==================================================================
BUG: KASAN: null-ptr-deref in f2fs_issue_flush+0x11c/0x8b8 fs/f2fs/segment.c:-1
Write of size 4 at addr 000000000000005c by task syz.4.13/4478

CPU: 1 PID: 4478 Comm: syz.4.13 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
print_report+0x40/0x68 mm/kasan/report.c:423
kasan_report+0xa8/0x100 mm/kasan/report.c:524
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x260/0x2a0 mm/kasan/generic.c:189
__kasan_check_write+0x2c/0x3c mm/kasan/shadow.c:37
f2fs_issue_flush+0x11c/0x8b8 fs/f2fs/segment.c:-1
f2fs_do_sync_file+0xe20/0x1740 fs/f2fs/file.c:380
f2fs_ioc_commit_atomic_write fs/f2fs/file.c:2253 [inline]
__f2fs_ioctl+0x33c0/0xaab8 fs/f2fs/file.c:4315
f2fs_ioctl+0x130/0x1a0 fs/f2fs/file.c:4403
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl fs/ioctl.c:856 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
==================================================================
Unable to handle kernel NULL pointer dereference at virtual address 000000000000005c
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=000000010bdfb000
[000000000000005c] pgd=080000011124d003, p4d=080000011124d003, pud=0800000110e37003, pmd=0000000000000000
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 4478 Comm: syz.4.13 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : __lse_atomic_add arch/arm64/include/asm/atomic_lse.h:27 [inline]
pc : arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline]
pc : arch_atomic_inc include/linux/atomic/atomic-arch-fallback.h:424 [inline]
pc : atomic_inc include/linux/atomic/atomic-instrumented.h:191 [inline]
pc : f2fs_issue_flush+0x12c/0x8b8 fs/f2fs/segment.c:578
lr : __lse_atomic_add arch/arm64/include/asm/atomic_lse.h:27 [inline]
lr : arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline]
lr : arch_atomic_inc include/linux/atomic/atomic-arch-fallback.h:424 [inline]
lr : atomic_inc include/linux/atomic/atomic-instrumented.h:191 [inline]
lr : f2fs_issue_flush+0x128/0x8b8 fs/f2fs/segment.c:578
sp : ffff800022ee74c0
x29: ffff800022ee75c0 x28: ffff0000ce82cf94 x27: dfff800000000000
x26: ffff7000045dce9c x25: 0000000000000000 x24: 00000000000001c5
x23: ffff800022ee7500 x22: 000000000000000a x21: ffff0000ce82c000
x20: 000000000000005c x19: 00000000180022de x18: ffff800011abbcc0
x17: 1fffe00033ed797e x16: ffff800008042c8c x15: 0000000040000000
x14: 0000000000000002 x13: 0000000000ff0100 x12: 0000000000080000
x11: 0000000000018536 x10: ffff80002869a000 x9 : ffff80000a302114
x8 : 0000000000000001 x7 : 0000000000000004 x6 : ffff800008251e10
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff800008191794
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
__lse_atomic_add arch/arm64/include/asm/atomic_lse.h:-1 [inline]
arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline]
arch_atomic_inc include/linux/atomic/atomic-arch-fallback.h:424 [inline]
atomic_inc include/linux/atomic/atomic-instrumented.h:191 [inline]
f2fs_issue_flush+0x12c/0x8b8 fs/f2fs/segment.c:578
f2fs_do_sync_file+0xe20/0x1740 fs/f2fs/file.c:380
f2fs_ioc_commit_atomic_write fs/f2fs/file.c:2253 [inline]
__f2fs_ioctl+0x33c0/0xaab8 fs/f2fs/file.c:4315
f2fs_ioctl+0x130/0x1a0 fs/f2fs/file.c:4403
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl fs/ioctl.c:856 [inline]
__arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
Code: 375008b3 d503201f 97867de2 52800028 (b828029f)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: 375008b3 tbnz w19, #10, 0x114
4: d503201f nop
8: 97867de2 bl 0xfffffffffe19f790
c: 52800028 mov w8, #0x1 // #1
* 10: b828029f stadd w8, [x20] <-- trapping instruction


---
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 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,
Oct 1, 2025, 1:36:28 AM (2 days ago) Oct 1
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 7b34dc04e4ff Linux 6.1.154
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=122a85cd980000
kernel config: https://syzkaller.appspot.com/x/.config?x=68aa5a3af1cb953a
dashboard link: https://syzkaller.appspot.com/bug?extid=1f2ac055dbc0980c23b3
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1634a334580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11fffd6f980000
mounted in repro: https://storage.googleapis.com/syzbot-assets/2516cb9a9cc6/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=17a28092580000)

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

option from the mount to silence this warning.
=======================================================
F2FS-fs (loop0): Try to recover all the superblocks, ret: 0
==================================================================
BUG: KASAN: null-ptr-deref in f2fs_issue_flush+0x11c/0x8b8 fs/f2fs/segment.c:-1
Write of size 4 at addr 000000000000005c by task syz.0.17/4488

CPU: 1 PID: 4488 Comm: syz.0.17 Not tainted syzkaller #0
user pgtable: 4k pages, 48-bit VAs, pgdp=000000012eb58000
[000000000000005c] pgd=080000011d353003, p4d=080000011d353003, pud=0800000115058003, pmd=0000000000000000
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 4488 Comm: syz.0.17 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : __lse_atomic_add arch/arm64/include/asm/atomic_lse.h:27 [inline]
pc : arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline]
pc : arch_atomic_inc include/linux/atomic/atomic-arch-fallback.h:424 [inline]
pc : atomic_inc include/linux/atomic/atomic-instrumented.h:191 [inline]
pc : f2fs_issue_flush+0x12c/0x8b8 fs/f2fs/segment.c:578
lr : __lse_atomic_add arch/arm64/include/asm/atomic_lse.h:27 [inline]
lr : arch_atomic_add arch/arm64/include/asm/atomic.h:28 [inline]
lr : arch_atomic_inc include/linux/atomic/atomic-arch-fallback.h:424 [inline]
lr : atomic_inc include/linux/atomic/atomic-instrumented.h:191 [inline]
lr : f2fs_issue_flush+0x128/0x8b8 fs/f2fs/segment.c:578
sp : ffff8000211e74c0
x29: ffff8000211e75c0 x28: ffff0000d895cf94 x27: dfff800000000000
x26: ffff70000423ce9c x25: 0000000000000000 x24: 00000000000001c5
x23: ffff8000211e7500 x22: 000000000000000a x21: ffff0000d895c000
x20: 000000000000005c x19: 00000000180022de x18: ffff800011abbcc0
x17: 0000000000000000 x16: ffff800008042c8c x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000ff0100
x11: ff0080000a302114 x10: 0000000000000000 x9 : ffff80000a302114
x8 : 0000000000000001 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff8000211e6e98 x4 : ffff8000151a4820 x3 : ffff800008191794
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.
Reply all
Reply to author
Forward
0 new messages