syzbot
KASAN: null-ptr-deref Write in __ext4_handle_dirty_metadata
Status:
premoderation: reported on 2026/06/24 01:42
Reported-by: syzbot+a12f90bbcf43ce4de3fa@syzkaller.appspotmail.com
First crash: 65d, last: 65d
Sample crash report:
EXT4-fs error (device loop0): ext4_clear_blocks:883: inode #11: comm syz.0.331: attempt to clear invalid blocks 983260 len 1
EXT4-fs (loop0): Remounting filesystem read-only
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
BUG: KASAN: null-ptr-deref in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline]
BUG: KASAN: null-ptr-deref in queued_spin_lock include/asm-generic/qspinlock.h:111 [inline]
BUG: KASAN: null-ptr-deref in do_raw_spin_lock include/linux/spinlock.h:187 [inline]
BUG: KASAN: null-ptr-deref in __raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline]
BUG: KASAN: null-ptr-deref in _raw_spin_lock+0x87/0xf0 kernel/locking/spinlock.c:154
Write of size 4 at addr 00000000000000d4 by task syz.0.331/1743
CPU: 1 PID: 1743 Comm: syz.0.331 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
<TASK>
__dump_stack+0x21/0x24 lib/dump_stack.c:88
dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
print_report+0x3d/0x60 mm/kasan/report.c:423
kasan_report+0x122/0x150 mm/kasan/report.c:524
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
__kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37
instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline]
queued_spin_lock include/asm-generic/qspinlock.h:111 [inline]
do_raw_spin_lock include/linux/spinlock.h:187 [inline]
__raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline]
_raw_spin_lock+0x87/0xf0 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:351 [inline]
mark_buffer_dirty_inode+0x116/0x300 fs/buffer.c:625
__ext4_handle_dirty_metadata+0x252/0x7e0 fs/ext4/ext4_jbd2.c:384
ext4_free_data+0x328/0x380 fs/ext4/indirect.c:985
ext4_free_branches+0x6e/0x6b0 fs/ext4/indirect.c:1115
ext4_free_branches+0x2f3/0x6b0 fs/ext4/indirect.c:1049
ext4_ind_truncate+0x8bd/0xbd0 fs/ext4/indirect.c:1201
ext4_truncate+0x97c/0x1000 fs/ext4/inode.c:4306
ext4_process_orphan+0x1d0/0x300 fs/ext4/orphan.c:337
ext4_orphan_cleanup+0xb5d/0x1270 fs/ext4/orphan.c:472
__ext4_fill_super fs/ext4/super.c:5561 [inline]
ext4_fill_super+0x6a53/0x73e0 fs/ext4/super.c:5680
get_tree_bdev+0x450/0x6a0 fs/super.c:1371
ext4_get_tree+0x1c/0x20 fs/ext4/super.c:5710
vfs_get_tree+0x9a/0x270 fs/super.c:1578
do_new_mount+0x251/0xb40 fs/namespace.c:3081
path_mount+0x640/0xfd0 fs/namespace.c:3411
do_mount fs/namespace.c:3424 [inline]
__do_sys_mount fs/namespace.c:3632 [inline]
__se_sys_mount+0x320/0x390 fs/namespace.c:3609
__x64_sys_mount+0xbf/0xd0 fs/namespace.c:3609
x64_sys_call+0x65d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fac1639e0ca
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fac17334e58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fac17334ee0 RCX: 00007fac1639e0ca
RDX: 0000200000000040 RSI: 0000200000000a00 RDI: 00007fac17334ea0
RBP: 0000200000000040 R08: 00007fac17334ee0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000a00
R13: 00007fac17334ea0 R14: 0000000000000488 R15: 000000000000002c
</TASK>
==================================================================
BUG: kernel NULL pointer dereference, address: 00000000000000d4
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 10d2ad067 P4D 10d2ad067 PUD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 1743 Comm: syz.0.331 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
RIP: 0010:arch_atomic_try_cmpxchg arch/x86/include/asm/atomic.h:202 [inline]
RIP: 0010:atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:543 [inline]
RIP: 0010:queued_spin_lock include/asm-generic/qspinlock.h:111 [inline]
RIP: 0010:do_raw_spin_lock include/linux/spinlock.h:187 [inline]
RIP: 0010:__raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline]
RIP: 0010:_raw_spin_lock+0x9d/0xf0 kernel/locking/spinlock.c:154
Code: 44 24 20 00 00 00 00 48 89 df be 04 00 00 00 e8 b9 06 b6 fc 4c 89 f7 be 04 00 00 00 e8 ac 06 b6 fc 8b 44 24 20 b9 01 00 00 00 <f0> 0f b1 0b 75 33 43 c6 44 27 04 f8 48 c7 04 24 0e 36 e0 45 4b c7
RSP: 0018:ffffc9000ea77260 EFLAGS: 00010297
RAX: 0000000000000000 RBX: 00000000000000d4 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffc9000ea77280
RBP: ffffc9000ea772f0 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff52001d4ee50 R12: dffffc0000000000
R13: ffff8881336e3c28 R14: ffffc9000ea77280 R15: 1ffff92001d4ee4c
FS: 00007fac173356c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000000d4 CR3: 000000011f196000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
spin_lock include/linux/spinlock.h:351 [inline]
mark_buffer_dirty_inode+0x116/0x300 fs/buffer.c:625
__ext4_handle_dirty_metadata+0x252/0x7e0 fs/ext4/ext4_jbd2.c:384
ext4_free_data+0x328/0x380 fs/ext4/indirect.c:985
ext4_free_branches+0x6e/0x6b0 fs/ext4/indirect.c:1115
ext4_free_branches+0x2f3/0x6b0 fs/ext4/indirect.c:1049
ext4_ind_truncate+0x8bd/0xbd0 fs/ext4/indirect.c:1201
ext4_truncate+0x97c/0x1000 fs/ext4/inode.c:4306
ext4_process_orphan+0x1d0/0x300 fs/ext4/orphan.c:337
ext4_orphan_cleanup+0xb5d/0x1270 fs/ext4/orphan.c:472
__ext4_fill_super fs/ext4/super.c:5561 [inline]
ext4_fill_super+0x6a53/0x73e0 fs/ext4/super.c:5680
get_tree_bdev+0x450/0x6a0 fs/super.c:1371
ext4_get_tree+0x1c/0x20 fs/ext4/super.c:5710
vfs_get_tree+0x9a/0x270 fs/super.c:1578
do_new_mount+0x251/0xb40 fs/namespace.c:3081
path_mount+0x640/0xfd0 fs/namespace.c:3411
do_mount fs/namespace.c:3424 [inline]
__do_sys_mount fs/namespace.c:3632 [inline]
__se_sys_mount+0x320/0x390 fs/namespace.c:3609
__x64_sys_mount+0xbf/0xd0 fs/namespace.c:3609
x64_sys_call+0x65d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fac1639e0ca
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fac17334e58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fac17334ee0 RCX: 00007fac1639e0ca
RDX: 0000200000000040 RSI: 0000200000000a00 RDI: 00007fac17334ea0
RBP: 0000200000000040 R08: 00007fac17334ee0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000a00
R13: 00007fac17334ea0 R14: 0000000000000488 R15: 000000000000002c
</TASK>
Modules linked in:
CR2: 00000000000000d4
---[ end trace 0000000000000000 ]---
RIP: 0010:arch_atomic_try_cmpxchg arch/x86/include/asm/atomic.h:202 [inline]
RIP: 0010:atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:543 [inline]
RIP: 0010:queued_spin_lock include/asm-generic/qspinlock.h:111 [inline]
RIP: 0010:do_raw_spin_lock include/linux/spinlock.h:187 [inline]
RIP: 0010:__raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline]
RIP: 0010:_raw_spin_lock+0x9d/0xf0 kernel/locking/spinlock.c:154
Code: 44 24 20 00 00 00 00 48 89 df be 04 00 00 00 e8 b9 06 b6 fc 4c 89 f7 be 04 00 00 00 e8 ac 06 b6 fc 8b 44 24 20 b9 01 00 00 00 <f0> 0f b1 0b 75 33 43 c6 44 27 04 f8 48 c7 04 24 0e 36 e0 45 4b c7
RSP: 0018:ffffc9000ea77260 EFLAGS: 00010297
RAX: 0000000000000000 RBX: 00000000000000d4 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffffc9000ea77280
RBP: ffffc9000ea772f0 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff52001d4ee50 R12: dffffc0000000000
R13: ffff8881336e3c28 R14: ffffc9000ea77280 R15: 1ffff92001d4ee4c
FS: 00007fac173356c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000000d4 CR3: 000000011f196000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 44 24 20 rex.R and $0x20,%al
3: 00 00 add %al,(%rax)
5: 00 00 add %al,(%rax)
7: 48 89 df mov %rbx,%rdi
a: be 04 00 00 00 mov $0x4,%esi
f: e8 b9 06 b6 fc call 0xfcb606cd
14: 4c 89 f7 mov %r14,%rdi
17: be 04 00 00 00 mov $0x4,%esi
1c: e8 ac 06 b6 fc call 0xfcb606cd
21: 8b 44 24 20 mov 0x20(%rsp),%eax
25: b9 01 00 00 00 mov $0x1,%ecx
* 2a: f0 0f b1 0b lock cmpxchg %ecx,(%rbx) <-- trapping instruction
2e: 75 33 jne 0x63
30: 43 c6 44 27 04 f8 movb $0xf8,0x4(%r15,%r12,1)
36: 48 c7 04 24 0e 36 e0 movq $0x45e0360e,(%rsp)
3d: 45
3e: 4b rex.WXB
3f: c7 .byte 0xc7
* Struck through repros no longer work on HEAD.