[syzbot] [ntfs3?] general protection fault in ni_readpage_cmpr

10 views
Skip to first unread message

syzbot

unread,
Apr 11, 2023, 5:05:42 AM4/11/23
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, nt...@lists.linux.dev, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: aa318c48808c Merge tag 'gpio-fixes-for-v6.3-rc6' of git://..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10496611c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=adfc55aec6afccdd
dashboard link: https://syzkaller.appspot.com/bug?extid=af224b63e76b2d869bc3
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3f2cda6aed35/disk-aa318c48.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b3abc5d6e123/vmlinux-aa318c48.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5e21f7b0c192/bzImage-aa318c48.xz

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

RBP: 00007f5102ac71d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0001000000201005 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd8c6b1d4f R14: 00007f5102ac7300 R15: 0000000000022000
</TASK>
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 0 PID: 21645 Comm: syz-executor.1 Not tainted 6.3.0-rc5-syzkaller-00153-gaa318c48808c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
RIP: 0010:_compound_head include/linux/page-flags.h:251 [inline]
RIP: 0010:unlock_page+0x25/0x130 mm/folio-compat.c:21
Code: 00 00 00 00 00 f3 0f 1e fa 41 54 55 48 89 fd 53 e8 c0 24 d2 ff 48 8d 7d 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 e4 00 00 00 4c 8b 65 08 31 ff 4c 89 e3 83 e3 01
RSP: 0018:ffffc900047e7520 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000008 RCX: ffffc90003b51000
RDX: 0000000000000001 RSI: ffffffff81afd3b0 RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88801e052988 R14: 0000000000000000 R15: 0000000000000000
FS: 00007f5102ac7700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f5102ac8000 CR3: 000000007c8da000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
ni_readpage_cmpr+0x44a/0xcd0 fs/ntfs3/frecord.c:2149
ntfs_read_folio+0x101/0x1e0 fs/ntfs3/inode.c:703
filemap_read_folio+0xdb/0x2c0 mm/filemap.c:2424
filemap_create_folio mm/filemap.c:2552 [inline]
filemap_get_pages+0x42a/0x1620 mm/filemap.c:2605
filemap_read+0x35e/0xc70 mm/filemap.c:2693
generic_file_read_iter+0x3ad/0x5b0 mm/filemap.c:2840
ntfs_file_read_iter+0x1b8/0x270 fs/ntfs3/file.c:758
call_read_iter include/linux/fs.h:1845 [inline]
generic_file_splice_read+0x182/0x4b0 fs/splice.c:402
do_splice_to+0x1b9/0x240 fs/splice.c:885
splice_direct_to_actor+0x2ab/0x8a0 fs/splice.c:956
do_splice_direct+0x1ab/0x280 fs/splice.c:1065
do_sendfile+0xb19/0x12c0 fs/read_write.c:1255
__do_sys_sendfile64 fs/read_write.c:1323 [inline]
__se_sys_sendfile64 fs/read_write.c:1309 [inline]
__x64_sys_sendfile64+0x1d0/0x210 fs/read_write.c:1309
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f5101c8c169
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5102ac7168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f5101dabf80 RCX: 00007f5101c8c169
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00007f5102ac71d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0001000000201005 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd8c6b1d4f R14: 00007f5102ac7300 R15: 0000000000022000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:_compound_head include/linux/page-flags.h:251 [inline]
RIP: 0010:unlock_page+0x25/0x130 mm/folio-compat.c:21
Code: 00 00 00 00 00 f3 0f 1e fa 41 54 55 48 89 fd 53 e8 c0 24 d2 ff 48 8d 7d 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 e4 00 00 00 4c 8b 65 08 31 ff 4c 89 e3 83 e3 01
RSP: 0018:ffffc900047e7520 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000008 RCX: ffffc90003b51000
RDX: 0000000000000001 RSI: ffffffff81afd3b0 RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88801e052988 R14: 0000000000000000 R15: 0000000000000000
FS: 00007f5102ac7700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f5102ac8000 CR3: 000000007c8da000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 00 00 add %al,(%rax)
4: 00 f3 add %dh,%bl
6: 0f 1e fa nop %edx
9: 41 54 push %r12
b: 55 push %rbp
c: 48 89 fd mov %rdi,%rbp
f: 53 push %rbx
10: e8 c0 24 d2 ff callq 0xffd224d5
15: 48 8d 7d 08 lea 0x8(%rbp),%rdi
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 48 89 fa mov %rdi,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction
2e: 0f 85 e4 00 00 00 jne 0x118
34: 4c 8b 65 08 mov 0x8(%rbp),%r12
38: 31 ff xor %edi,%edi
3a: 4c 89 e3 mov %r12,%rbx
3d: 83 e3 01 and $0x1,%ebx


---
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

unread,
May 7, 2023, 6:30:46 AM5/7/23
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, nt...@lists.linux.dev, syzkall...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 14f8db1c0f9a 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=14ecc3b0280000
kernel config: https://syzkaller.appspot.com/x/.config?x=a837a8ba7e88bb45
dashboard link: https://syzkaller.appspot.com/bug?extid=af224b63e76b2d869bc3
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=168ce182280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1308c522280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ad6ce516eed3/disk-14f8db1c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1f38c2cc7667/vmlinux-14f8db1c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d795115eee39/Image-14f8db1c.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/8a3eac658458/mount_0.gz

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

__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193
el0_svc+0x4c/0x15c arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591
Unable to handle kernel paging request at virtual address dfff800000000001
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
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
[dfff800000000001] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 5930 Comm: syz-executor385 Not tainted 6.3.0-rc7-syzkaller-g14f8db1c0f9a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : _compound_head include/linux/page-flags.h:251 [inline]
pc : unlock_page+0x28/0x74 mm/folio-compat.c:21
lr : unlock_page+0x18/0x74 mm/folio-compat.c:20
sp : ffff80001e4d6fa0
x29: ffff80001e4d6fa0 x28: 0000000000000007 x27: 00000000fffffff4
x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
x23: ffff0000d9371208 x22: 0000000000000001 x21: dfff800000000000
x20: 0000000000000008 x19: 0000000000000000 x18: 1fffe0003684a5b6
x17: 0000000000000000 x16: ffff8000084fa124 x15: 0000000000000001
x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000001
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000001
x8 : dfff800000000000 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001e4d61d8 x4 : ffff800015e4ccc0 x3 : ffff80000968c944
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
_compound_head include/linux/page-flags.h:251 [inline]
unlock_page+0x28/0x74 mm/folio-compat.c:21
ni_readpage_cmpr+0x474/0x798 fs/ntfs3/frecord.c:2149
ntfs_read_folio+0x14c/0x1c0 fs/ntfs3/inode.c:703
filemap_read_folio+0x14c/0x39c mm/filemap.c:2424
filemap_create_folio mm/filemap.c:2552 [inline]
filemap_get_pages+0xb3c/0x1640 mm/filemap.c:2605
filemap_read+0x354/0xc98 mm/filemap.c:2693
generic_file_read_iter+0xa0/0x450 mm/filemap.c:2840
ntfs_file_read_iter+0x184/0x1e0 fs/ntfs3/file.c:758
call_read_iter include/linux/fs.h:1845 [inline]
generic_file_splice_read+0x1e0/0x508 fs/splice.c:402
do_splice_to fs/splice.c:885 [inline]
splice_direct_to_actor+0x30c/0x944 fs/splice.c:956
do_splice_direct+0x1f4/0x334 fs/splice.c:1065
do_sendfile+0x4bc/0xc70 fs/read_write.c:1255
__do_sys_sendfile64 fs/read_write.c:1323 [inline]
__se_sys_sendfile64 fs/read_write.c:1309 [inline]
__arm64_sys_sendfile64+0x160/0x3b4 fs/read_write.c:1309
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193
el0_svc+0x4c/0x15c arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591
Code: d2d00008 91002274 f2fbffe8 d343fe89 (38686928)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: d2d00008 mov x8, #0x800000000000 // #140737488355328
4: 91002274 add x20, x19, #0x8
8: f2fbffe8 movk x8, #0xdfff, lsl #48
c: d343fe89 lsr x9, x20, #3
* 10: 38686928 ldrb w8, [x9, x8] <-- trapping instruction


---
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.

syzbot

unread,
Jun 11, 2023, 6:17:28 PM6/11/23
to ak...@linux-foundation.org, almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, ne...@suse.de, nt...@lists.linux.dev, syzkall...@googlegroups.com, torv...@linux-foundation.org
syzbot has bisected this issue to:

commit 9fd472af84abd6da15376353c2283b3df9497646
Author: NeilBrown <ne...@suse.de>
Date: Tue Mar 22 21:38:54 2022 +0000

mm: improve cleanup when ->readpages doesn't process all pages

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1285d453280000
start commit: 64569520920a Merge tag 'block-6.4-2023-06-09' of git://git..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=1185d453280000
console output: https://syzkaller.appspot.com/x/log.txt?x=1685d453280000
kernel config: https://syzkaller.appspot.com/x/.config?x=3c980bfe8b399968
dashboard link: https://syzkaller.appspot.com/bug?extid=af224b63e76b2d869bc3
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15835795280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16966d43280000

Reported-by: syzbot+af224b...@syzkaller.appspotmail.com
Fixes: 9fd472af84ab ("mm: improve cleanup when ->readpages doesn't process all pages")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Nov 21, 2023, 10:58:07 AM11/21/23
to ak...@linux-foundation.org, almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, ne...@suse.de, nt...@lists.linux.dev, syzkall...@googlegroups.com, torv...@linux-foundation.org
syzbot suspects this issue was fixed by commit:

commit 013ff63b649475f0ee134e2c8d0c8e65284ede50
Author: Konstantin Komarov <almaz.ale...@paragon-software.com>
Date: Fri Jun 30 12:17:02 2023 +0000

fs/ntfs3: Add more attributes checks in mi_enum_attr()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14b8bcbf680000
start commit: 1b29d271614a Merge tag 'staging-6.4-rc7' of git://git.kern..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=ac246111fb601aec
dashboard link: https://syzkaller.appspot.com/bug?extid=af224b63e76b2d869bc3
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1241fd03280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1476e8f3280000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: fs/ntfs3: Add more attributes checks in mi_enum_attr()

syzbot

unread,
Dec 30, 2023, 12:23:14 AM12/30/23
to syzkall...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages