[syzbot] general protection fault in do_mpage_readpage

15 views
Skip to first unread message

syzbot

unread,
Jun 20, 2022, 7:29:24 AM6/20/22
to linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, vi...@zeniv.linux.org.uk
Hello,

syzbot found the following issue on:

HEAD commit: 1e502319853c Add linux-next specific files for 20220620
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1738ba60080000
kernel config: https://syzkaller.appspot.com/x/.config?x=58357279cb2cfd50
dashboard link: https://syzkaller.appspot.com/bug?extid=dbbd022e608bb122cf4e
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.

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

loop1: detected capacity change from 0 to 8191
loop1:
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 1 PID: 8799 Comm: syz-executor.1 Not tainted 5.19.0-rc3-next-20220620-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:map_buffer_to_folio fs/mpage.c:107 [inline]
RIP: 0010:do_mpage_readpage+0xfe8/0x19f0 fs/mpage.c:228
Code: 85 ed 0f 84 98 01 00 00 49 be 00 00 00 00 00 fc ff df 4c 89 ed 45 31 e4 eb 2c e8 63 79 92 ff 48 8d 7d 08 48 89 f8 48 c1 e8 03 <42> 80 3c 30 00 0f 85 53 08 00 00 48 8b 6d 08 41 83 c4 01 49 39 ed
RSP: 0018:ffffc900043c77c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000002 RCX: ffffc90003e61000
RDX: 0000000000040000 RSI: ffffffff81e8340d RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: dffffc0000000000 R15: ffffc900043c7960
FS: 00007fa91daa5700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055555556e708 CR3: 0000000050217000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
mpage_read_folio+0xa5/0x140 fs/mpage.c:378
ntfs_read_folio+0x148/0x1e0 fs/ntfs3/inode.c:706
filemap_read_folio+0x3c/0x1d0 mm/filemap.c:2396
do_read_cache_folio+0x251/0x5b0 mm/filemap.c:3521
do_read_cache_page mm/filemap.c:3563 [inline]
read_cache_page+0x59/0x2a0 mm/filemap.c:3572
read_mapping_page include/linux/pagemap.h:758 [inline]
ntfs_map_page fs/ntfs3/ntfs_fs.h:897 [inline]
ntfs_fill_super+0x27e9/0x3730 fs/ntfs3/super.c:1145
get_tree_bdev+0x4a2/0x7e0 fs/super.c:1294
vfs_get_tree+0x89/0x2f0 fs/super.c:1501
do_new_mount fs/namespace.c:3040 [inline]
path_mount+0x1320/0x1fa0 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]
__x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7fa91c88a63a
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 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:00007fa91daa4f88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007fa91c88a63a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fa91daa4fe0
RBP: 00007fa91daa5020 R08: 00007fa91daa5020 R09: 0000000020000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000020000000
R13: 0000000020000100 R14: 00007fa91daa4fe0 R15: 000000002007c8e0
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:map_buffer_to_folio fs/mpage.c:107 [inline]
RIP: 0010:do_mpage_readpage+0xfe8/0x19f0 fs/mpage.c:228
Code: 85 ed 0f 84 98 01 00 00 49 be 00 00 00 00 00 fc ff df 4c 89 ed 45 31 e4 eb 2c e8 63 79 92 ff 48 8d 7d 08 48 89 f8 48 c1 e8 03 <42> 80 3c 30 00 0f 85 53 08 00 00 48 8b 6d 08 41 83 c4 01 49 39 ed
RSP: 0018:ffffc900043c77c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000002 RCX: ffffc90003e61000
RDX: 0000000000040000 RSI: ffffffff81e8340d RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: dffffc0000000000 R15: ffffc900043c7960
FS: 00007fa91daa5700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055555556e708 CR3: 0000000050217000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 85 ed test %ebp,%ebp
2: 0f 84 98 01 00 00 je 0x1a0
8: 49 be 00 00 00 00 00 movabs $0xdffffc0000000000,%r14
f: fc ff df
12: 4c 89 ed mov %r13,%rbp
15: 45 31 e4 xor %r12d,%r12d
18: eb 2c jmp 0x46
1a: e8 63 79 92 ff callq 0xff927982
1f: 48 8d 7d 08 lea 0x8(%rbp),%rdi
23: 48 89 f8 mov %rdi,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) <-- trapping instruction
2f: 0f 85 53 08 00 00 jne 0x888
35: 48 8b 6d 08 mov 0x8(%rbp),%rbp
39: 41 83 c4 01 add $0x1,%r12d
3d: 49 39 ed cmp %rbp,%r13


---
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,
Jun 21, 2022, 5:04:35 PM6/21/22
to linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, vi...@zeniv.linux.org.uk
syzbot has found a reproducer for the following issue on:

HEAD commit: 34d1d36073ea Add linux-next specific files for 20220621
git tree: linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=11eeec3ff00000
kernel config: https://syzkaller.appspot.com/x/.config?x=b24b62d1c051cfc8
dashboard link: https://syzkaller.appspot.com/bug?extid=dbbd022e608bb122cf4e
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1216c174080000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14362fd8080000

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

loop0: detected capacity change from 0 to 8191
ntfs3: loop0: Mark volume as dirty due to NTFS errors
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: 3604 Comm: syz-executor200 Not tainted 5.19.0-rc3-next-20220621-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:map_buffer_to_folio fs/mpage.c:107 [inline]
RIP: 0010:do_mpage_readpage+0xfe8/0x19f0 fs/mpage.c:228
Code: 85 ed 0f 84 98 01 00 00 49 be 00 00 00 00 00 fc ff df 4c 89 ed 45 31 e4 eb 2c e8 73 8f 93 ff 48 8d 7d 08 48 89 f8 48 c1 e8 03 <42> 80 3c 30 00 0f 85 53 08 00 00 48 8b 6d 08 41 83 c4 01 49 39 ed
RSP: 0018:ffffc90002f9f7c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000002 RCX: 0000000000000000
RDX: ffff8880206957c0 RSI: ffffffff81e72ddd RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: dffffc0000000000 R15: ffffc90002f9f960
FS: 000055555626d300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005d84c8 CR3: 000000007e93c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
mpage_read_folio+0xa5/0x140 fs/mpage.c:378
ntfs_read_folio+0x148/0x1e0 fs/ntfs3/inode.c:706
filemap_read_folio+0x3c/0x1d0 mm/filemap.c:2396
do_read_cache_folio+0x251/0x5b0 mm/filemap.c:3521
do_read_cache_page mm/filemap.c:3563 [inline]
read_cache_page+0x59/0x2a0 mm/filemap.c:3572
read_mapping_page include/linux/pagemap.h:756 [inline]
ntfs_map_page fs/ntfs3/ntfs_fs.h:897 [inline]
ntfs_fill_super+0x27e9/0x3730 fs/ntfs3/super.c:1145
get_tree_bdev+0x4a2/0x7e0 fs/super.c:1294
vfs_get_tree+0x89/0x2f0 fs/super.c:1501
do_new_mount fs/namespace.c:3040 [inline]
path_mount+0x1320/0x1fa0 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]
__x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f240cf2feaa
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffefafe8648 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffefafe86a0 RCX: 00007f240cf2feaa
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffefafe8660
RBP: 00007ffefafe8660 R08: 00007ffefafe86a0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000286 R12: 00000000200034e8
R13: 0000000000000003 R14: 0000000000000004 R15: 000000000000021f
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:map_buffer_to_folio fs/mpage.c:107 [inline]
RIP: 0010:do_mpage_readpage+0xfe8/0x19f0 fs/mpage.c:228
Code: 85 ed 0f 84 98 01 00 00 49 be 00 00 00 00 00 fc ff df 4c 89 ed 45 31 e4 eb 2c e8 73 8f 93 ff 48 8d 7d 08 48 89 f8 48 c1 e8 03 <42> 80 3c 30 00 0f 85 53 08 00 00 48 8b 6d 08 41 83 c4 01 49 39 ed
RSP: 0018:ffffc90002f9f7c0 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000002 RCX: 0000000000000000
RDX: ffff8880206957c0 RSI: ffffffff81e72ddd RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000004 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: dffffc0000000000 R15: ffffc90002f9f960
FS: 000055555626d300(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f240cf1fd20 CR3: 000000007e93c000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 85 ed test %ebp,%ebp
2: 0f 84 98 01 00 00 je 0x1a0
8: 49 be 00 00 00 00 00 movabs $0xdffffc0000000000,%r14
f: fc ff df
12: 4c 89 ed mov %r13,%rbp
15: 45 31 e4 xor %r12d,%r12d
18: eb 2c jmp 0x46
1a: e8 73 8f 93 ff callq 0xff938f92

Hillf Danton

unread,
Jun 23, 2022, 7:09:54 AM6/23/22
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Tue, 21 Jun 2022 14:04:34 -0700
See if it is due to invalid bh.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 34d1d36073ea

--- y/fs/mpage.c
+++ x/fs/mpage.c
@@ -94,6 +94,9 @@ static void map_buffer_to_folio(struct f
return;
}
create_empty_buffers(&folio->page, i_blocksize(inode), 0);
+ head = folio_buffers(folio);
+ if (!head)
+ return;
}

page_bh = head;
--

syzbot

unread,
Jun 23, 2022, 10:38:08 AM6/23/22
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+dbbd02...@syzkaller.appspotmail.com

Tested on:

commit: 34d1d360 Add linux-next specific files for 20220621
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
console output: https://syzkaller.appspot.com/x/log.txt?x=11096f7ff00000
kernel config: https://syzkaller.appspot.com/x/.config?x=b24b62d1c051cfc8
dashboard link: https://syzkaller.appspot.com/bug?extid=dbbd022e608bb122cf4e
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=15d4eb1ff00000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Jun 25, 2022, 9:29:08 AM6/25/22
to hda...@sina.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, vi...@zeniv.linux.org.uk, wi...@infradead.org
syzbot has bisected this issue to:

commit 4c27dc762d7b60fa23c6eab2309ca6fc625588dd
Author: Matthew Wilcox (Oracle) <wi...@infradead.org>
Date: Sat Jun 11 02:58:24 2022 +0000

mpage: Convert do_mpage_readpage() to use a folio

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16d2a888080000
start commit: 34d1d36073ea Add linux-next specific files for 20220621
git tree: linux-next
final oops: https://syzkaller.appspot.com/x/report.txt?x=15d2a888080000
console output: https://syzkaller.appspot.com/x/log.txt?x=11d2a888080000
Reported-by: syzbot+dbbd02...@syzkaller.appspotmail.com
Fixes: 4c27dc762d7b ("mpage: Convert do_mpage_readpage() to use a folio")

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

syzbot

unread,
Nov 25, 2022, 11:34:31 AM11/25/22
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