syzbot


general protection fault in inherit_task_group

Status: fixed on 2023/12/21 03:45
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+756fe9affda890e892ae@syzkaller.appspotmail.com
Fix commit: a71ef31485bb perf/core: Fix potential NULL deref
First crash: 402d, last: 400d
Cause bisection: introduced by (bisect log) :
commit 32671e3799ca2e4590773fd0e63aaa4229e50c06
Author: Peter Zijlstra <peterz@infradead.org>
Date: Wed Oct 18 11:56:54 2023 +0000

  perf: Disallow mis-matched inherited group reads

Crash: BUG: unable to handle kernel NULL pointer dereference in inherit_task_group (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit a71ef31485bb51b846e8db8b3a35e432cc15afb5
Author: Peter Zijlstra <peterz@infradead.org>
Date: Tue Oct 24 09:42:21 2023 +0000

  perf/core: Fix potential NULL deref

  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [perf?] general protection fault in inherit_task_group 2 (4) 2023/11/29 12:21
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 general protection fault in inherit_task_group C 22 24d 289d 0/2 upstream: reported C repro on 2024/02/16 22:46
linux-6.1 general protection fault in inherit_task_group origin:upstream missing-backport C inconclusive 3 310d 401d 0/3 upstream: reported C repro on 2023/10/28 05:24
linux-5.15 general protection fault in inherit_task_group origin:upstream C done 4 396d 401d 3/3 fixed on 2023/12/05 18:06
android-6-1 general protection fault in inherit_task_group origin:downstream C 1 149d 289d 0/2 auto-obsoleted due to no activity on 2024/10/14 11:46
android-5-10 general protection fault in inherit_task_group C 24 3d20h 289d 0/2 upstream: reported C repro on 2024/02/16 23:02
android-5-15 general protection fault in inherit_task_group origin:downstream C 8 2d23h 289d 0/2 upstream: reported C repro on 2024/02/16 23:09
Last patch testing requests (3)
Created Duration User Patch Repo Result
2023/11/12 15:16 22m retest repro bpf-next OK log
2023/11/12 12:28 30m retest repro bpf OK log
2023/11/12 12:28 25m retest repro bpf OK log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000011: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000088-0x000000000000008f]
CPU: 0 PID: 5052 Comm: syz-executor420 Not tainted 6.6.0-rc7-syzkaller-00089-gc17cda15cc86 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
RIP: 0010:inherit_group kernel/events/core.c:13375 [inline]
RIP: 0010:inherit_task_group.isra.0+0x248/0x5e0 kernel/events/core.c:13422
Code: 38 d0 7c 08 84 d2 0f 85 18 03 00 00 49 8d bf 8c 00 00 00 8b 9b 8c 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 eb
RSP: 0018:ffffc90003b1fa48 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000011 RSI: ffffffff81b0fbc9 RDI: 000000000000008c
RBP: ffff88801ce578a0 R08: 0000000000000005 R09: 0000000000000001
R10: 0000000000000001 R11: ffffffff8a60008b R12: 0000000000000000
R13: ffff88807532bb80 R14: ffffc90003b1fae0 R15: 0000000000000000
FS:  00007f07e8df36c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f07e8df3fe8 CR3: 0000000078a1f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 perf_event_init_context kernel/events/core.c:13487 [inline]
 perf_event_init_task+0x330/0x740 kernel/events/core.c:13538
 copy_process+0x242c/0x73f0 kernel/fork.c:2475
 kernel_clone+0xfd/0x920 kernel/fork.c:2909
 __do_sys_clone+0xba/0x100 kernel/fork.c:3052
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f07e8e324d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 18 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f07e8df3228 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007f07e8ebc308 RCX: 00007f07e8e324d9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007f07e8ebc300 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f07e8ebc30c
R13: 0000000000000016 R14: 00007ffca721dd10 R15: 00007ffca721ddf8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:inherit_group kernel/events/core.c:13375 [inline]
RIP: 0010:inherit_task_group.isra.0+0x248/0x5e0 kernel/events/core.c:13422
Code: 38 d0 7c 08 84 d2 0f 85 18 03 00 00 49 8d bf 8c 00 00 00 8b 9b 8c 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 eb
RSP: 0018:ffffc90003b1fa48 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000011 RSI: ffffffff81b0fbc9 RDI: 000000000000008c
RBP: ffff88801ce578a0 R08: 0000000000000005 R09: 0000000000000001
R10: 0000000000000001 R11: ffffffff8a60008b R12: 0000000000000000
R13: ffff88807532bb80 R14: ffffc90003b1fae0 R15: 0000000000000000
FS:  00007f07e8df36c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f07e8e5ef20 CR3: 0000000078a1f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	38 d0                	cmp    %dl,%al
   2:	7c 08                	jl     0xc
   4:	84 d2                	test   %dl,%dl
   6:	0f 85 18 03 00 00    	jne    0x324
   c:	49 8d bf 8c 00 00 00 	lea    0x8c(%r15),%rdi
  13:	8b 9b 8c 00 00 00    	mov    0x8c(%rbx),%ebx
  19:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  20:	fc ff df
  23:	48 89 fa             	mov    %rdi,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	0f b6 14 02          	movzbl (%rdx,%rax,1),%edx <-- trapping instruction
  2e:	48 89 f8             	mov    %rdi,%rax
  31:	83 e0 07             	and    $0x7,%eax
  34:	83 c0 03             	add    $0x3,%eax
  37:	38 d0                	cmp    %dl,%al
  39:	7c 08                	jl     0x43
  3b:	84 d2                	test   %dl,%dl
  3d:	0f                   	.byte 0xf
  3e:	85 eb                	test   %ebp,%ebx

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/28 03:50 bpf c17cda15cc86 3c418d72 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce general protection fault in inherit_task_group
2023/10/28 03:19 bpf-next 6808918343a8 3c418d72 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce general protection fault in inherit_task_group
2023/10/27 12:00 bpf c17cda15cc86 bf285f0c .config console log report syz [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce general protection fault in inherit_task_group
2023/10/29 10:31 bpf c17cda15cc86 3c418d72 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce general protection fault in inherit_task_group
* Struck through repros no longer work on HEAD.