syzbot


BUG: unable to handle kernel paging request in bpf_probe_read_compat_str

Status: upstream: reported C repro on 2024/01/23 14:36
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+074dc22dbf0e3162a7ce@syzkaller.appspotmail.com
First crash: 121d, last: 76d
Fix commit to backport (bisect log) :
tree: upstream
commit 32019c659ecfe1d92e3bf9fcdfbb11a7c70acd58
Author: Hou Tao <houtao1@huawei.com>
Date: Fri Feb 2 10:39:34 2024 +0000

  x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()

  
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: BUG: unable to handle kernel paging request in bpf_probe_read_compat_str (log)
Repro: C syz .config
  
Bug presence (3)
Date Name Commit Repro Result
2024/03/08 linux-6.1.y (ToT) 61adba85cc40 C [report] BUG: unable to handle kernel paging request in bpf_probe_read_compat_str
2024/01/23 upstream (ToT) 7ed2632ec7d7 C [report] BUG: unable to handle kernel paging request in bpf_probe_read_compat_str
2024/03/08 upstream (ToT) 3aaa8ce7a335 C Didn't crash
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: unable to handle kernel paging request in bpf_probe_read_compat_str mm C done 4 93d 117d 0/26 upstream: reported C repro on 2024/01/27 00:25
android-5-15 BUG: unable to handle kernel paging request in bpf_probe_read_compat_str origin:upstream missing-backport C 2 11d 121d 0/2 upstream: reported C repro on 2024/01/23 03:08
android-6-1 BUG: unable to handle kernel paging request in bpf_probe_read_compat_str origin:upstream missing-backport C error 3 31d 121d 0/2 upstream: reported C repro on 2024/01/22 23:16
linux-5.15 BUG: unable to handle kernel paging request in bpf_probe_read_compat_str origin:upstream missing-backport C done 1 76d 121d 0/3 upstream: reported C repro on 2024/01/22 23:41
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2024/03/10 20:46 4h01m fix candidate upstream job log (1)
2024/02/24 21:43 1h22m bisect fix linux-6.1.y job log (0) 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 ce91067 P4D ce91067 PUD ce93067 PMD ceb6067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.1.74-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:strncpy_from_kernel_nofault+0x89/0x1c0 mm/maccess.c:91
Code: 00 48 89 d0 48 c1 e8 03 48 89 44 24 10 0f b6 04 28 84 c0 48 89 14 24 0f 85 d5 00 00 00 ff 02 45 31 f6 49 89 df 48 8b 54 24 08 <42> 8a 1c 33 4a 8d 3c 32 48 89 f8 48 c1 e8 03 49 89 ec 0f b6 04 28
RSP: 0018:ffffc90000177a78 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffffff600000 RCX: ffff88813fef1dc0
RDX: ffffc90000177b08 RSI: ffffffffff600000 RDI: ffffffffff600000
RBP: dffffc0000000000 R08: ffffffff813dd769 R09: ffffed1027fde3b9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffffff600000
R13: 0000000000000008 R14: 0000000000000000 R15: ffffffffff600000
FS:  0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000007a3bf000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bpf_probe_read_kernel_str_common kernel/trace/bpf_trace.c:265 [inline]
 ____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:313 [inline]
 bpf_probe_read_compat_str+0x10a/0x180 kernel/trace/bpf_trace.c:306
 bpf_prog_f17ebaf3f5f7baf8+0x3a/0x3c
 bpf_dispatcher_nop_func include/linux/bpf.h:979 [inline]
 __bpf_prog_run include/linux/filter.h:600 [inline]
 bpf_prog_run include/linux/filter.h:607 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2275 [inline]
 bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2316
 trace_sched_switch include/trace/events/sched.h:222 [inline]
 __schedule+0x2116/0x4550 kernel/sched/core.c:6555
 schedule_idle+0x4a/0x90 kernel/sched/core.c:6662
 do_idle+0x62d/0x680 kernel/sched/idle.c:331
 cpu_startup_entry+0x3d/0x60 kernel/sched/idle.c:401
 start_secondary+0xe4/0xf0 arch/x86/kernel/smpboot.c:281
 secondary_startup_64_no_verify+0xcf/0xdb
 </TASK>
Modules linked in:
CR2: ffffffffff600000
---[ end trace 0000000000000000 ]---
RIP: 0010:strncpy_from_kernel_nofault+0x89/0x1c0 mm/maccess.c:91
Code: 00 48 89 d0 48 c1 e8 03 48 89 44 24 10 0f b6 04 28 84 c0 48 89 14 24 0f 85 d5 00 00 00 ff 02 45 31 f6 49 89 df 48 8b 54 24 08 <42> 8a 1c 33 4a 8d 3c 32 48 89 f8 48 c1 e8 03 49 89 ec 0f b6 04 28
RSP: 0018:ffffc90000177a78 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffffffffff600000 RCX: ffff88813fef1dc0
RDX: ffffc90000177b08 RSI: ffffffffff600000 RDI: ffffffffff600000
RBP: dffffc0000000000 R08: ffffffff813dd769 R09: ffffed1027fde3b9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffffff600000
R13: 0000000000000008 R14: 0000000000000000 R15: ffffffffff600000
FS:  0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000007a3bf000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	00 48 89             	add    %cl,-0x77(%rax)
   3:	d0 48 c1             	rorb   -0x3f(%rax)
   6:	e8 03 48 89 44       	call   0x4489480e
   b:	24 10                	and    $0x10,%al
   d:	0f b6 04 28          	movzbl (%rax,%rbp,1),%eax
  11:	84 c0                	test   %al,%al
  13:	48 89 14 24          	mov    %rdx,(%rsp)
  17:	0f 85 d5 00 00 00    	jne    0xf2
  1d:	ff 02                	incl   (%rdx)
  1f:	45 31 f6             	xor    %r14d,%r14d
  22:	49 89 df             	mov    %rbx,%r15
  25:	48 8b 54 24 08       	mov    0x8(%rsp),%rdx
* 2a:	42 8a 1c 33          	mov    (%rbx,%r14,1),%bl <-- trapping instruction
  2e:	4a 8d 3c 32          	lea    (%rdx,%r14,1),%rdi
  32:	48 89 f8             	mov    %rdi,%rax
  35:	48 c1 e8 03          	shr    $0x3,%rax
  39:	49 89 ec             	mov    %rbp,%r12
  3c:	0f b6 04 28          	movzbl (%rax,%rbp,1),%eax

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/01/23 14:35 linux-6.1.y 8fd7f4462453 1c0ecc51 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf BUG: unable to handle kernel paging request in bpf_probe_read_compat_str
* Struck through repros no longer work on HEAD.