syzbot


BUG: unable to handle kernel paging request in clear_user_rep_good

Status: fixed on 2023/06/08 14:41
Subsystems: iomap
[Documentation on labels]
Reported-by: syzbot+401145a9a237779feb26@syzkaller.appspotmail.com
Fix commit: d2c95f9d6802 x86: don't use REP_GOOD or ERMS for user memory clearing
First crash: 441d, last: 380d
Cause bisection: failed (error log, bisect log)
  
Fix bisection: fixed by (bisect log) :
commit d2c95f9d6802cc518d71d9795f4d9da54fb4e24d
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sat Apr 15 20:22:31 2023 +0000

  x86: don't use REP_GOOD or ERMS for user memory clearing

  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [ntfs3?] [btrfs?] BUG: unable to handle kernel paging request in clear_user_rep_good 4 (6) 2023/05/03 10:31
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2023/04/30 22:57 5h32m bisect fix upstream job log (1)
2023/03/31 22:17 39m bisect fix upstream job log (0) log
2023/03/01 11:06 35m bisect fix upstream job log (0) log

Sample crash report:
BUG: unable to handle page fault for address: 0000000020081000
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 1c9cc067 P4D 1c9cc067 PUD 280e9067 PMD 2a76b067 PTE 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 5441 Comm: syz-executor.1 Not tainted 6.2.0-rc5-syzkaller-00221-gab072681eabe #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
RIP: 0010:clear_user_rep_good+0x1c/0x30 arch/x86/lib/clear_page_64.S:147
Code: 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 48 83 f9 40 72 a6 89 ca 48 c1 e9 03 74 03 f3 48 ab 83 e2 07 74 04 89 d1 <f3> aa 31 c0 c3 48 c1 e1 03 83 e2 07 48 01 d1 eb f1 0f 1f 00 f3 0f
RSP: 0018:ffffc900056f76d8 EFLAGS: 00050202
RAX: 0000000000000000 RBX: 0000000000081002 RCX: 0000000000000002
RDX: 0000000000000002 RSI: ffffffff84098c49 RDI: 0000000020081000
RBP: 0000000000081002 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000094001 R12: ffffc900056f7d70
R13: 0000000020000000 R14: 000000007ffff000 R15: 0000000000000000
FS:  00007fc1837f1700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020081000 CR3: 000000002b26e000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 __clear_user arch/x86/include/asm/uaccess_64.h:103 [inline]
 clear_user arch/x86/include/asm/uaccess_64.h:124 [inline]
 iov_iter_zero+0x709/0x1290 lib/iov_iter.c:800
 iomap_dio_hole_iter fs/iomap/direct-io.c:389 [inline]
 iomap_dio_iter fs/iomap/direct-io.c:440 [inline]
 __iomap_dio_rw+0xe3d/0x1cd0 fs/iomap/direct-io.c:601
 iomap_dio_rw+0x40/0xa0 fs/iomap/direct-io.c:689
 ext4_dio_read_iter fs/ext4/file.c:94 [inline]
 ext4_file_read_iter+0x4be/0x690 fs/ext4/file.c:145
 call_read_iter include/linux/fs.h:2183 [inline]
 do_iter_readv_writev+0x2e0/0x3b0 fs/read_write.c:733
 do_iter_read+0x2f2/0x750 fs/read_write.c:796
 vfs_readv+0xe5/0x150 fs/read_write.c:916
 do_preadv+0x1b6/0x270 fs/read_write.c:1008
 __do_sys_preadv2 fs/read_write.c:1070 [inline]
 __se_sys_preadv2 fs/read_write.c:1061 [inline]
 __x64_sys_preadv2+0xef/0x150 fs/read_write.c:1061
 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:0x7fc182a8c0c9
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:00007fc1837f1168 EFLAGS: 00000246 ORIG_RAX: 0000000000000147
RAX: ffffffffffffffda RBX: 00007fc182babf80 RCX: 00007fc182a8c0c9
RDX: 0000000000000001 RSI: 0000000020000100 RDI: 0000000000000003
RBP: 00007fc182ae7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000007fffe R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffefd64d1ef R14: 00007fc1837f1300 R15: 0000000000022000
 </TASK>
Modules linked in:
CR2: 0000000020081000
---[ end trace 0000000000000000 ]---
RIP: 0010:clear_user_rep_good+0x1c/0x30 arch/x86/lib/clear_page_64.S:147
Code: 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 48 83 f9 40 72 a6 89 ca 48 c1 e9 03 74 03 f3 48 ab 83 e2 07 74 04 89 d1 <f3> aa 31 c0 c3 48 c1 e1 03 83 e2 07 48 01 d1 eb f1 0f 1f 00 f3 0f
RSP: 0018:ffffc900056f76d8 EFLAGS: 00050202
RAX: 0000000000000000 RBX: 0000000000081002 RCX: 0000000000000002
RDX: 0000000000000002 RSI: ffffffff84098c49 RDI: 0000000020081000
RBP: 0000000000081002 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000094001 R12: ffffc900056f7d70
R13: 0000000020000000 R14: 000000007ffff000 R15: 0000000000000000
FS:  00007fc1837f1700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8294a2a000 CR3: 000000002b26e000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess):
   0:	66 66 2e 0f 1f 84 00 	data16 nopw %cs:0x0(%rax,%rax,1)
   7:	00 00 00 00
   b:	0f 1f 00             	nopl   (%rax)
   e:	f3 0f 1e fa          	endbr64
  12:	48 83 f9 40          	cmp    $0x40,%rcx
  16:	72 a6                	jb     0xffffffbe
  18:	89 ca                	mov    %ecx,%edx
  1a:	48 c1 e9 03          	shr    $0x3,%rcx
  1e:	74 03                	je     0x23
  20:	f3 48 ab             	rep stos %rax,%es:(%rdi)
  23:	83 e2 07             	and    $0x7,%edx
  26:	74 04                	je     0x2c
  28:	89 d1                	mov    %edx,%ecx
* 2a:	f3 aa                	rep stos %al,%es:(%rdi) <-- trapping instruction
  2c:	31 c0                	xor    %eax,%eax
  2e:	c3                   	retq
  2f:	48 c1 e1 03          	shl    $0x3,%rcx
  33:	83 e2 07             	and    $0x7,%edx
  36:	48 01 d1             	add    %rdx,%rcx
  39:	eb f1                	jmp    0x2c
  3b:	0f 1f 00             	nopl   (%rax)
  3e:	f3                   	repz
  3f:	0f                   	.byte 0xf

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/30 07:59 upstream ab072681eabe 9dfcf09c .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci-upstream-kasan-gce-root BUG: unable to handle kernel paging request in clear_user_rep_good
2023/01/30 07:43 upstream ab072681eabe 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root BUG: unable to handle kernel paging request in clear_user_rep_good
* Struck through repros no longer work on HEAD.