syzbot


BUG: unable to handle kernel paging request in bpf_probe_read_kernel_str

Status: upstream: reported C repro on 2024/02/07 07:16
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+a0fa177e13690b663c74@syzkaller.appspotmail.com
First crash: 70d, last: 50d
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 bpf_probe_read_kernel_str (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [mm?] BUG: unable to handle kernel paging request in bpf_probe_read_kernel_str 0 (1) 2024/02/07 07:16
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 BUG: unable to handle kernel paging request in bpf_probe_read_kernel_str origin:upstream C done 1 36d 67d 3/3 fixed on 2024/04/08 12:30
android-6-1 BUG: unable to handle kernel paging request in bpf_probe_read_kernel_str origin:upstream missing-backport C 3 11d 70d 0/2 upstream: reported C repro on 2024/02/03 06:51
linux-5.15 BUG: unable to handle kernel paging request in bpf_probe_read_kernel_str origin:upstream C done 1 37d 70d 3/3 fixed on 2024/04/08 12:30
android-5-15 BUG: unable to handle kernel paging request in bpf_probe_read_kernel_str origin:upstream missing-backport C 2 8d23h 68d 0/2 upstream: reported C repro on 2024/02/05 22:23
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/02/23 21:26 53m retest repro net-next OK log
2024/02/23 21:26 18m retest repro bpf-next report log
2024/02/23 20:51 24m retest repro bpf OK log
2024/02/23 20:20 24m retest repro net OK 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 df36067 P4D df36067 PUD df38067 PMD df5b067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 PID: 5064 Comm: syz-executor171 Not tainted 6.8.0-rc1-syzkaller-00523-g6fb3f72702fb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
RIP: 0010:strncpy_from_kernel_nofault+0x8d/0x1d0 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 d9 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:ffffc90003b5f888 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffffffffff600000 RCX: ffff88801871d940
RDX: ffffc90003b5f900 RSI: ffffffffff600000 RDI: ffffffffff600000
RBP: dffffc0000000000 R08: ffffffff8141da1d R09: 1ffffffff2591484
R10: dffffc0000000000 R11: ffffffffa0001f90 R12: ffffffffff600000
R13: 0000000000000005 R14: 0000000000000000 R15: ffffffffff600000
FS:  0000000000000000(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000000df32000 CR4: 00000000003506f0
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:266 [inline]
 ____bpf_probe_read_kernel_str kernel/trace/bpf_trace.c:275 [inline]
 bpf_probe_read_kernel_str+0x2a/0x70 kernel/trace/bpf_trace.c:272
 bpf_prog_ef3a4661c9d1378e+0x4a/0x4c
 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [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:2381 [inline]
 bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420
 trace_kfree include/trace/events/kmem.h:94 [inline]
 kfree+0x28e/0x380 mm/slub.c:4396
 vma_numab_state_free include/linux/mm.h:638 [inline]
 __vm_area_free+0x42/0x110 kernel/fork.c:505
 remove_vma mm/mmap.c:146 [inline]
 exit_mmap+0x6a9/0xd40 mm/mmap.c:3301
 __mmput+0x115/0x3c0 kernel/fork.c:1343
 exit_mm+0x21f/0x310 kernel/exit.c:569
 do_exit+0x9af/0x2740 kernel/exit.c:858
 do_group_exit+0x206/0x2c0 kernel/exit.c:1020
 __do_sys_exit_group kernel/exit.c:1031 [inline]
 __se_sys_exit_group kernel/exit.c:1029 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1029
 do_syscall_64+0xf9/0x240
 entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7fddca0c0c89
Code: Unable to access opcode bytes at 0x7fddca0c0c5f.
RSP: 002b:00007fff7476ad38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fddca0c0c89
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007fddca13b290 R08: ffffffffffffffb8 R09: 0000000000000006
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fddca13b290
R13: 0000000000000000 R14: 00007fddca13bce0 R15: 00007fddca091ec0
 </TASK>
Modules linked in:
CR2: ffffffffff600000
---[ end trace 0000000000000000 ]---
RIP: 0010:strncpy_from_kernel_nofault+0x8d/0x1d0 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 d9 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:ffffc90003b5f888 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffffffffff600000 RCX: ffff88801871d940
RDX: ffffc90003b5f900 RSI: ffffffffff600000 RDI: ffffffffff600000
RBP: dffffc0000000000 R08: ffffffff8141da1d R09: 1ffffffff2591484
R10: dffffc0000000000 R11: ffffffffa0001f90 R12: ffffffffff600000
R13: 0000000000000005 R14: 0000000000000000 R15: ffffffffff600000
FS:  0000000000000000(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000000df32000 CR4: 00000000003506f0
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 d9 00 00 00    	jne    0xf6
  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 (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/02/03 07:12 bpf-next 6fb3f72702fb 60bf9982 .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 bpf_probe_read_kernel_str
2024/02/09 20:19 net 02d9009f4e8c 77b23aa1 .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 bpf_probe_read_kernel_str
2024/02/03 10:34 bpf 577e4432f3ac 60bf9982 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce BUG: unable to handle kernel paging request in bpf_probe_read_kernel_str
2024/02/05 17:49 net-next a8882313c564 4e988e80 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce BUG: unable to handle kernel paging request in bpf_probe_read_kernel_str
* Struck through repros no longer work on HEAD.