syzbot


BUG: unable to handle kernel paging request in copy_from_kernel_nofault

Status: fixed on 2024/03/29 01:33
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+72aa0161922eba61b50e@syzkaller.appspotmail.com
Fix commit: 32019c659ecf x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()
First crash: 222d, last: 119d
Cause bisection: introduced by (bisect log) :
commit ca247283781d754216395a41c5e8be8ec79a5f1c
Author: Andy Lutomirski <luto@kernel.org>
Date: Wed Feb 10 02:33:45 2021 +0000

  x86/fault: Don't run fixups for SMAP violations

Crash: BUG: unable to handle kernel paging request in copy_from_kernel_nofault (log)
Repro: C syz .config
  
Discussions (14)
Title Replies (including bot) Last reply
[PATCH 5.10 015/238] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/03/24 23:36
[PATCH 5.15 016/317] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/03/24 23:29
[PATCH 6.1 034/451] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/03/24 23:05
[PATCH 6.6 028/638] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/03/24 22:51
[PATCH 6.7 033/713] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/03/24 22:35
[PATCH AUTOSEL 5.10 4/8] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/02/29 20:41
[PATCH AUTOSEL 5.15 5/9] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/02/29 20:41
[PATCH AUTOSEL 6.1 06/12] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/02/29 20:40
[PATCH AUTOSEL 6.6 08/22] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/02/29 20:39
[PATCH AUTOSEL 6.7 09/24] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/02/29 20:36
[PATCH bpf v3 2/3] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 4 (4) 2024/02/15 11:13
[PATCH bpf v2 2/3] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 3 (3) 2024/01/30 04:18
[PATCH bpf 2/3] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 1 (1) 2024/01/19 07:30
[syzbot] [mm?] BUG: unable to handle kernel paging request in copy_from_kernel_nofault 4 (5) 2023/12/21 11:59
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: unable to handle kernel paging request in copy_from_kernel_nofault (2) mm C 2 74d 84d 26/27 fixed on 2024/05/22 23:36
linux-5.15 BUG: unable to handle kernel paging request in copy_from_kernel_nofault origin:upstream C done 2 119d 222d 3/3 fixed on 2024/03/28 13:37
linux-6.1 KASAN: stack-out-of-bounds Write in copy_from_kernel_nofault origin:lts-only C unreliable 3 119d 449d 0/3 upstream: reported C repro on 2023/04/02 16:05
android-5-15 BUG: unable to handle kernel paging request in copy_from_kernel_nofault origin:upstream missing-backport C 122 6d10h 222d 0/2 upstream: reported C repro on 2023/11/15 17:36
android-6-1 BUG: unable to handle kernel paging request in copy_from_kernel_nofault origin:upstream missing-backport C done inconclusive 127 6d10h 222d 0/2 upstream: reported C repro on 2023/11/15 17:20
Last patch testing requests (5)
Created Duration User Patch Repo Result
2024/02/07 20:46 15m retest repro net report log
2024/01/11 12:44 14m retest repro bpf-next report log
2023/12/28 00:49 2h12m retest repro net-next report log
2023/12/14 00:30 13m retest repro bpf report log
2023/11/29 20:14 14m retest repro net report log

Sample crash report:
BUG: unable to handle page fault for address: ffffffffff600000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD cd7a067 P4D cd7a067 PUD cd7c067 PMD cd9f067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5071 Comm: syz-executor322 Not tainted 6.6.0-syzkaller-15867-g1fda5bb66ad8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:copy_from_kernel_nofault mm/maccess.c:36 [inline]
RIP: 0010:copy_from_kernel_nofault+0x86/0x240 mm/maccess.c:24
Code: ea 03 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 ab 01 00 00 41 83 85 6c 17 00 00 01 eb 1e e8 ba 23 cf ff <48> 8b 45 00 49 89 04 24 48 83 c5 08 49 83 c4 08 48 83 eb 08 e8 a1
RSP: 0018:ffffc900038d7ae8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000008 RCX: ffffffff81b8690c
RDX: ffff888016ab0000 RSI: ffffffff81b868e6 RDI: 0000000000000007
RBP: ffffffffff600000 R08: 0000000000000007 R09: 0000000000000007
R10: 0000000000000008 R11: 0000000000000001 R12: ffffc900038d7b30
R13: ffff888016ab0000 R14: dffffc0000000000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000000cd77000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bpf_probe_read_kernel_common include/linux/bpf.h:2747 [inline]
 ____bpf_probe_read_kernel kernel/trace/bpf_trace.c:236 [inline]
 bpf_probe_read_kernel+0x26/0x70 kernel/trace/bpf_trace.c:233
 bpf_prog_bd8b22826c103b08+0x42/0x44
 bpf_dispatcher_nop_func include/linux/bpf.h:1196 [inline]
 __bpf_prog_run include/linux/filter.h:651 [inline]
 bpf_prog_run include/linux/filter.h:658 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2307 [inline]
 bpf_trace_run2+0x14e/0x410 kernel/trace/bpf_trace.c:2346
 trace_kfree include/trace/events/kmem.h:94 [inline]
 kfree+0xec/0x150 mm/slab_common.c:1043
 vma_numab_state_free include/linux/mm.h:638 [inline]
 __vm_area_free+0x3e/0x140 kernel/fork.c:525
 remove_vma+0x128/0x170 mm/mmap.c:146
 exit_mmap+0x453/0xa70 mm/mmap.c:3332
 __mmput+0x12a/0x4d0 kernel/fork.c:1349
 mmput+0x62/0x70 kernel/fork.c:1371
 exit_mm kernel/exit.c:567 [inline]
 do_exit+0x9ad/0x2ae0 kernel/exit.c:858
 do_group_exit+0xd4/0x2a0 kernel/exit.c:1021
 __do_sys_exit_group kernel/exit.c:1032 [inline]
 __se_sys_exit_group kernel/exit.c:1030 [inline]
 __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1030
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7fe1c24c2dc9
Code: Unable to access opcode bytes at 0x7fe1c24c2d9f.
RSP: 002b:00007ffd4d4b8dc8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe1c24c2dc9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007fe1c253e290 R08: ffffffffffffffb8 R09: 0000000000000006
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe1c253e290
R13: 0000000000000000 R14: 00007fe1c253ece0 R15: 00007fe1c2494030
 </TASK>
Modules linked in:
CR2: ffffffffff600000
---[ end trace 0000000000000000 ]---
RIP: 0010:copy_from_kernel_nofault mm/maccess.c:36 [inline]
RIP: 0010:copy_from_kernel_nofault+0x86/0x240 mm/maccess.c:24
Code: ea 03 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 ab 01 00 00 41 83 85 6c 17 00 00 01 eb 1e e8 ba 23 cf ff <48> 8b 45 00 49 89 04 24 48 83 c5 08 49 83 c4 08 48 83 eb 08 e8 a1
RSP: 0018:ffffc900038d7ae8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000008 RCX: ffffffff81b8690c
RDX: ffff888016ab0000 RSI: ffffffff81b868e6 RDI: 0000000000000007
RBP: ffffffffff600000 R08: 0000000000000007 R09: 0000000000000007
R10: 0000000000000008 R11: 0000000000000001 R12: ffffc900038d7b30
R13: ffff888016ab0000 R14: dffffc0000000000 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000000cd77000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	03 0f                	add    (%rdi),%ecx
   2:	b6 14                	mov    $0x14,%dh
   4:	02 48 89             	add    -0x77(%rax),%cl
   7:	f8                   	clc
   8:	83 e0 07             	and    $0x7,%eax
   b:	83 c0 03             	add    $0x3,%eax
   e:	38 d0                	cmp    %dl,%al
  10:	7c 08                	jl     0x1a
  12:	84 d2                	test   %dl,%dl
  14:	0f 85 ab 01 00 00    	jne    0x1c5
  1a:	41 83 85 6c 17 00 00 	addl   $0x1,0x176c(%r13)
  21:	01
  22:	eb 1e                	jmp    0x42
  24:	e8 ba 23 cf ff       	call   0xffcf23e3
* 29:	48 8b 45 00          	mov    0x0(%rbp),%rax <-- trapping instruction
  2d:	49 89 04 24          	mov    %rax,(%r12)
  31:	48 83 c5 08          	add    $0x8,%rbp
  35:	49 83 c4 08          	add    $0x8,%r12
  39:	48 83 eb 08          	sub    $0x8,%rbx
  3d:	e8                   	.byte 0xe8
  3e:	a1                   	.byte 0xa1

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/15 20:04 bpf 1fda5bb66ad8 cb976f63 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce BUG: unable to handle kernel paging request in copy_from_kernel_nofault
2023/11/15 17:41 net 674e31808946 cb976f63 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce BUG: unable to handle kernel paging request in copy_from_kernel_nofault
2024/02/26 20:19 bpf-next 2ab256e93249 edd6a5e9 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce BUG: unable to handle kernel paging request in copy_from_kernel_nofault
2023/11/15 17:53 net-next 8fedaaca4071 cb976f63 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce BUG: unable to handle kernel paging request in copy_from_kernel_nofault
2023/11/15 17:43 bpf-next 81427a62a221 cb976f63 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce BUG: unable to handle kernel paging request in copy_from_kernel_nofault
* Struck through repros no longer work on HEAD.