syzbot


BUG: unable to handle kernel paging request in copy_from_kernel_nofault

Status: fixed on 2024/03/28 13:37
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+96daa2fe3463c3f8e0b0@syzkaller.appspotmail.com
Fix commit: e8a67fe34b76 x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()
First crash: 196d, last: 93d
Fix bisection: fixed by (bisect log) :
commit e8a67fe34b76a49320b33032228a794f40b0316b
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()

  
Bug presence (1)
Date Name Commit Repro Result
2023/11/15 upstream (ToT) c42d9eeef8e5 C [report] BUG: unable to handle kernel paging request in copy_from_kernel_nofault
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 48d 58d 26/26 fixed on 2024/05/22 23:36
upstream BUG: unable to handle kernel paging request in copy_from_kernel_nofault mm C done 5 93d 192d 26/26 fixed on 2024/03/29 01:33
linux-6.1 KASAN: stack-out-of-bounds Write in copy_from_kernel_nofault origin:lts-only C unreliable 3 93d 423d 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 98 6d18h 196d 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 100 6d18h 196d 0/2 upstream: reported C repro on 2023/11/15 17:20
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2024/03/27 21:51 3h33m bisect fix linux-5.15.y job log (1)
2024/02/17 14:40 56m bisect fix linux-5.15.y job log (0) log
2024/01/16 03:36 1h17m bisect fix linux-5.15.y job log (0) log
2023/12/15 23:30 1h27m bisect fix linux-5.15.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(0x0001) - permissions violation
PGD c691067 P4D c691067 PUD c693067 PMD c6b6067 PTE 800000000c609165
Oops: 0001 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 38 Comm: kworker/1:1 Not tainted 5.15.138-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Workqueue: events bpf_prog_free_deferred
RIP: 0010:copy_from_kernel_nofault+0x7d/0x2d0 mm/maccess.c:37
Code: 01 84 c0 0f 85 ed 01 00 00 41 ff 06 bf 07 00 00 00 4c 89 ee e8 d4 f2 d5 ff 49 83 fd 07 76 5c 4c 89 fb 49 83 c5 f8 49 83 c7 08 <49> 8b 2c 24 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df 80
RSP: 0018:ffffc900010dfa00 EFLAGS: 00010292
RAX: 0000000000000000 RBX: ffffc900010dfa68 RCX: ffff888014d83b80
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000007
RBP: ffffc900010dfa70 R08: ffffffff81aa335c R09: fffffbfff1f79c21
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffffff600000
R13: 0000000000000000 R14: ffff888014d85308 R15: ffffc900010dfa70
FS:  0000000000000000(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000001d8fa000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bpf_probe_read_kernel_common kernel/trace/bpf_trace.c:220 [inline]
 ____bpf_probe_read_kernel kernel/trace/bpf_trace.c:229 [inline]
 bpf_probe_read_kernel+0x26/0x70 kernel/trace/bpf_trace.c:226
 bpf_prog_bd8b22826c103b08+0x3a/0x65c
 bpf_dispatcher_nop_func include/linux/bpf.h:776 [inline]
 __bpf_prog_run include/linux/filter.h:625 [inline]
 bpf_prog_run include/linux/filter.h:632 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:1883 [inline]
 bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1920
 __bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:118
 trace_kfree include/trace/events/kmem.h:118 [inline]
 kfree+0x22f/0x270 mm/slub.c:4549
 __vunmap+0x977/0xa20 mm/vmalloc.c:2626
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
Modules linked in:
CR2: ffffffffff600000
---[ end trace c4788fdc6a5c6e02 ]---
RIP: 0010:copy_from_kernel_nofault+0x7d/0x2d0 mm/maccess.c:37
Code: 01 84 c0 0f 85 ed 01 00 00 41 ff 06 bf 07 00 00 00 4c 89 ee e8 d4 f2 d5 ff 49 83 fd 07 76 5c 4c 89 fb 49 83 c5 f8 49 83 c7 08 <49> 8b 2c 24 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df 80
RSP: 0018:ffffc900010dfa00 EFLAGS: 00010292
RAX: 0000000000000000 RBX: ffffc900010dfa68 RCX: ffff888014d83b80
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000007
RBP: ffffc900010dfa70 R08: ffffffff81aa335c R09: fffffbfff1f79c21
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffffff600000
R13: 0000000000000000 R14: ffff888014d85308 R15: ffffc900010dfa70
FS:  0000000000000000(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffff600000 CR3: 000000001d8fa000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	01 84 c0 0f 85 ed 01 	add    %eax,0x1ed850f(%rax,%rax,8)
   7:	00 00                	add    %al,(%rax)
   9:	41 ff 06             	incl   (%r14)
   c:	bf 07 00 00 00       	mov    $0x7,%edi
  11:	4c 89 ee             	mov    %r13,%rsi
  14:	e8 d4 f2 d5 ff       	call   0xffd5f2ed
  19:	49 83 fd 07          	cmp    $0x7,%r13
  1d:	76 5c                	jbe    0x7b
  1f:	4c 89 fb             	mov    %r15,%rbx
  22:	49 83 c5 f8          	add    $0xfffffffffffffff8,%r13
  26:	49 83 c7 08          	add    $0x8,%r15
* 2a:	49 8b 2c 24          	mov    (%r12),%rbp <-- trapping instruction
  2e:	48 89 d8             	mov    %rbx,%rax
  31:	48 c1 e8 03          	shr    $0x3,%rax
  35:	48 b9 00 00 00 00 00 	movabs $0xdffffc0000000000,%rcx
  3c:	fc ff df
  3f:	80                   	.byte 0x80

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/15 21:35 linux-5.15.y 80529b4968a8 cb976f63 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf BUG: unable to handle kernel paging request in copy_from_kernel_nofault
2024/02/26 20:31 linux-5.15.y 458ce51d0356 da36a36b .config console log report syz C ci2-linux-5-15-kasan-perf BUG: unable to handle kernel paging request in copy_from_kernel_nofault
* Struck through repros no longer work on HEAD.