[syzbot] BUG: unable to handle kernel NULL pointer dereference in ni_write_inode

19 views
Skip to first unread message

syzbot

unread,
Sep 23, 2022, 12:16:46 PM9/23/22
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, nt...@lists.linux.dev, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 16c9f284e746 Merge branch 'for-next/core', remote-tracking..
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=15e17bf8880000
kernel config: https://syzkaller.appspot.com/x/.config?x=15a770deac0c935a
dashboard link: https://syzkaller.appspot.com/bug?extid=f45957555ed4a808cc7a
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11827ec4880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1518404c880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/fd8978a3a764/disk-16c9f284.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/73ab1c321ad6/vmlinux-16c9f284.xz

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

loop0: detected capacity change from 0 to 264192
ntfs3: loop0: Failed to load $Extend.
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000016
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=000000010af56000
[0000000000000016] pgd=08000001090da003, p4d=08000001090da003, pud=08000001090ce003, pmd=0000000000000000
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 3036 Comm: syz-executor206 Not tainted 6.0.0-rc6-syzkaller-17739-g16c9f284e746 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : is_rec_inuse fs/ntfs3/ntfs.h:313 [inline]
pc : ni_write_inode+0xac/0x798 fs/ntfs3/frecord.c:3232
lr : ni_write_inode+0xa0/0x798 fs/ntfs3/frecord.c:3226
sp : ffff8000126c3800
x29: ffff8000126c3860 x28: 0000000000000000 x27: ffff0000c8b02000
x26: ffff0000c7502320 x25: ffff0000c7502288 x24: 0000000000000000
x23: ffff80000cbec91c x22: ffff0000c8b03000 x21: ffff0000c8b02000
x20: 0000000000000001 x19: ffff0000c75024d8 x18: 00000000000000c0
x17: ffff80000dd1b198 x16: ffff80000db59158 x15: ffff0000c4b6b500
x14: 00000000000000b8 x13: 0000000000000000 x12: ffff0000c4b6b500
x11: ff80800008be1b60 x10: 0000000000000000 x9 : ffff0000c4b6b500
x8 : 0000000000000000 x7 : ffff800008be1b50 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000
x2 : 0000000000000008 x1 : 0000000000000001 x0 : 0000000000000000
Call trace:
is_rec_inuse fs/ntfs3/ntfs.h:313 [inline]
ni_write_inode+0xac/0x798 fs/ntfs3/frecord.c:3232
ntfs_evict_inode+0x54/0x84 fs/ntfs3/inode.c:1744
evict+0xec/0x334 fs/inode.c:665
iput_final fs/inode.c:1748 [inline]
iput+0x2c4/0x324 fs/inode.c:1774
ntfs_new_inode+0x7c/0xe0 fs/ntfs3/fsntfs.c:1660
ntfs_create_inode+0x20c/0xe78 fs/ntfs3/inode.c:1278
ntfs_create+0x54/0x74 fs/ntfs3/namei.c:100
lookup_open fs/namei.c:3413 [inline]
open_last_lookups fs/namei.c:3481 [inline]
path_openat+0x804/0x11c4 fs/namei.c:3688
do_filp_open+0xdc/0x1b8 fs/namei.c:3718
do_sys_openat2+0xb8/0x22c fs/open.c:1311
do_sys_open fs/open.c:1327 [inline]
__do_sys_openat fs/open.c:1343 [inline]
__se_sys_openat fs/open.c:1338 [inline]
__arm64_sys_openat+0xb0/0xe0 fs/open.c:1338
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall arch/arm64/kernel/syscall.c:52 [inline]
el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654
el0t_64_sync+0x18c/0x190
Code: 97dafee4 340001b4 f9401328 2a1f03e0 (79402d14)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: 97dafee4 bl 0xffffffffff6bfb90
4: 340001b4 cbz w20, 0x38
8: f9401328 ldr x8, [x25, #32]
c: 2a1f03e0 mov w0, wzr
* 10: 79402d14 ldrh w20, [x8, #22] <-- 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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Sep 25, 2022, 2:44:23 AM9/25/22
to abdun....@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in writeback_single_inode

loop0: detected capacity change from 0 to 264192
------------[ cut here ]------------
WARNING: CPU: 1 PID: 17828 at fs/fs-writeback.c:1678 writeback_single_inode+0x374/0x388 fs/fs-writeback.c:1678
Modules linked in:
CPU: 1 PID: 17828 Comm: syz-executor.0 Not tainted 6.0.0-rc6-syzkaller-00321-g105a36f3694e-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : writeback_single_inode+0x374/0x388 fs/fs-writeback.c:1678
lr : writeback_single_inode+0x374/0x388 fs/fs-writeback.c:1678
sp : ffff80001569b9c0
x29: ffff80001569ba10 x28: 0000000000000000 x27: 0000000000000140
x26: 0000000000000002 x25: 0000000000000000 x24: 0000000000000001
x23: 0000000000001000 x22: ffff80001569ba60 x21: 0000000000000000
x20: ffff0000cabd824f x19: ffff0000cabd82d8 x18: 0000000000000246
x17: ffff80000c04d6bc x16: ffff80000dbb9658 x15: ffff0000cf4d1a80
x14: 0000000000000130 x13: 00000000ffffffff x12: ffff0000cf4d1a80
x11: ff80800008620110 x10: 0000000000000000 x9 : ffff800008620110
x8 : ffff0000cf4d1a80 x7 : ffff80000861fde0 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
writeback_single_inode+0x374/0x388 fs/fs-writeback.c:1678
write_inode_now+0xb0/0xdc fs/fs-writeback.c:2723
iput_final fs/inode.c:1735 [inline]
iput+0x1d4/0x314 fs/inode.c:1774
ntfs_fill_super+0x1254/0x14a4 fs/ntfs/super.c:188
get_tree_bdev+0x1e8/0x2a0 fs/super.c:1323
ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1358
vfs_get_tree+0x40/0x140 fs/super.c:1530
do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040
path_mount+0x358/0x914 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__arm64_sys_mount+0x2f8/0x408 fs/namespace.c:3568
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall arch/arm64/kernel/syscall.c:52 [inline]
el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x48/0x154 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:624
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
irq event stamp: 2340
hardirqs last enabled at (2339): [<ffff800008164cd4>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline]
hardirqs last enabled at (2339): [<ffff800008164cd4>] finish_lock_switch+0x94/0xe8 kernel/sched/core.c:4942
hardirqs last disabled at (2340): [<ffff80000c00271c>] el1_dbg+0x24/0x5c arch/arm64/kernel/entry-common.c:395
softirqs last enabled at (1156): [<ffff80000801c1f4>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (1154): [<ffff80000801c1c0>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
Unable to handle kernel paging request at virtual address 000000cabd847947
Mem abort info:
ESR = 0x0000000096000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=000000010ff83000
[000000cabd847947] pgd=0000000000000000, p4d=0000000000000000
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 17828 Comm: syz-executor.0 Tainted: G W 6.0.0-rc6-syzkaller-00321-g105a36f3694e-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : xa_marked include/linux/xarray.h:420 [inline]
pc : mapping_tagged include/linux/fs.h:461 [inline]
pc : writeback_single_inode+0x228/0x388 fs/fs-writeback.c:1703
lr : writeback_single_inode+0x218/0x388 fs/fs-writeback.c:1702
sp : ffff80001569b9c0
x29: ffff80001569ba10 x28: 0000000000000000 x27: 0000000000000140
x26: 0000000000000002 x25: 0000000000001000 x24: 0000000000000001
x23: 0000000000000001 x22: ffff80001569ba60 x21: ffff0000cabd8327
x20: ffff0000cabd824f x19: ffff0000cabd82d8 x18: 0000000000000246
x17: ffff80000c04d6bc x16: ffff80000dbb9658 x15: ffff0000cf4d1a80
x14: 0000000000000130 x13: 00000000ffffffff x12: ffff0000cf4d1a80
x11: ff8080000861ffb4 x10: 0000000000000000 x9 : ffff0000cf4d1a80
x8 : ff0000cabd8478ff x7 : ffff80000861fde0 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000
x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000000
Call trace:
xa_marked include/linux/xarray.h:420 [inline]
mapping_tagged include/linux/fs.h:461 [inline]
writeback_single_inode+0x228/0x388 fs/fs-writeback.c:1703
write_inode_now+0xb0/0xdc fs/fs-writeback.c:2723
iput_final fs/inode.c:1735 [inline]
iput+0x1d4/0x314 fs/inode.c:1774
ntfs_fill_super+0x1254/0x14a4 fs/ntfs/super.c:188
get_tree_bdev+0x1e8/0x2a0 fs/super.c:1323
ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1358
vfs_get_tree+0x40/0x140 fs/super.c:1530
do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040
path_mount+0x358/0x914 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__arm64_sys_mount+0x2f8/0x408 fs/namespace.c:3568
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall arch/arm64/kernel/syscall.c:52 [inline]
el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x48/0x154 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:624
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:642
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
Code: 710006ff 54000281 f9401a88 2a1f03e0 (b9404917)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: 710006ff cmp w23, #0x1
4: 54000281 b.ne 0x54 // b.any
8: f9401a88 ldr x8, [x20, #48]
c: 2a1f03e0 mov w0, wzr
* 10: b9404917 ldr w23, [x8, #72] <-- trapping instruction


Tested on:

commit: 105a36f3 Merge tag 'kbuild-fixes-v6.0-3' of git://git...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14f9fcdf080000
kernel config: https://syzkaller.appspot.com/x/.config?x=9329e35e88d766d1
dashboard link: https://syzkaller.appspot.com/bug?extid=f45957555ed4a808cc7a
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=10fc7688880000

Reply all
Reply to author
Forward
0 new messages