syzbot


general protection fault in reweight_entity

Status: fixed on 2022/02/23 11:01
Reported-by: syzbot+af7a719bc92395ee41b3@syzkaller.appspotmail.com
Fix commit: 4c47eaa7c828 BACKPORT: sched/fair: Fix fault in reweight_entity
First crash: 1075d, last: 1017d
Cause bisection: introduced by (bisect log) :
commit c85c6fadbef0a3eab41540ea628fa8fe8928c820
Author: Zhang Qiao <zhangqiao22@huawei.com>
Date: Wed Sep 15 06:40:30 2021 +0000

  kernel/sched: Fix sched_fork() access an invalid sched_task_group

Crash: general protection fault in reweight_entity (log)
Repro: C syz .config
  
Discussions (9)
Title Replies (including bot) Last reply
[PATCH 5.10 000/545] 5.10.137-rc1 review 570 (570) 2022/08/29 08:17
[PATCH 5.10 0/1] sched/fair: fix fault in reweight_entity() 3 (3) 2022/08/19 11:25
[PATCH 5.15 000/262] 5.15.27-rc1 review 280 (280) 2022/03/07 19:35
[PATCH 5.16 000/186] 5.16.13-rc1 review 188 (188) 2022/03/07 14:29
[PATCH 5.16 000/203] 5.16.10-rc1 review 221 (221) 2022/02/15 17:29
[PATCH 5.15 000/172] 5.15.24-rc1 review 183 (183) 2022/02/15 15:56
[PATCH v5] sched/fair: Fix fault in reweight_entity 3 (3) 2022/02/07 13:52
[PATCH v3] sched/fair: Fix fault in reweight_entity 6 (6) 2022/02/03 16:14
[PATCH v2] sched/fair: Fix fault in reweight_entity 5 (5) 2022/01/25 18:59
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in reweight_entity kernel C error done 10 1017d 1071d 22/28 fixed on 2023/02/24 13:50
upstream KASAN: slab-use-after-free Read in reweight_entity kernel C inconclusive error 626 284d 408d 0/28 closed as invalid on 2024/09/06 10:38
Last patch testing requests (4)
Created Duration User Patch Repo Result
2022/02/18 21:14 15m tadeusz.struk@linaro.org https://android.googlesource.com/kernel/common android12-5.10 OK
2022/02/16 20:03 14m tadeusz.struk@linaro.org https://android.googlesource.com/kernel/common android12-5.10 report log
2022/02/16 17:25 9m tadeusz.struk@linaro.org https://android.googlesource.com/kernel/common android12-5.10 report log
2022/02/16 17:17 0m tadeusz.struk@linaro.org https://android.googlesource.com/kernel/common 4c8c1a559d89f error
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2022/01/16 17:36 16m bisect fix android12-5.10-lts OK (0) job log log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000014: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000000a0-0x00000000000000a7]
CPU: 1 PID: 25258 Comm: syz-executor167 Not tainted 5.10.100-syzkaller-00843-g86e6176a4240 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:dequeue_load_avg kernel/sched/fair.c:3095 [inline]
RIP: 0010:reweight_entity+0x110/0x510 kernel/sched/fair.c:3114
Code: 80 3c 08 00 74 08 48 89 df e8 0c 3c 5a 00 48 89 5d 88 4c 8b 3b 4c 89 e8 48 c1 e8 03 48 89 45 b0 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ef e8 e2 3b 5a 00 49 8b 45 00 31 db 4c 29
RSP: 0018:ffffc90000c17c10 EFLAGS: 00010006
RAX: 0000000000000014 RBX: ffff888112bae4e0 RCX: dffffc0000000000
RDX: 0000000000044000 RSI: ffff888112bae340 RDI: 0000000000000000
RBP: ffffc90000c17ca8 R08: ffffffff86e40048 R09: ffffffff86e40058
R10: ffffffff86e40050 R11: ffffffff86e40043 R12: 0000000000000000
R13: 00000000000000a0 R14: ffff888112bae340 R15: 0000000000000400
FS:  00007f87d6fda700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f87d707daa8 CR3: 00000001161a9000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 reweight_task+0x8c/0x1a0 kernel/sched/fair.c:3139
 set_load_weight kernel/sched/core.c:902 [inline]
 set_user_nice+0x516/0xed0 kernel/sched/core.c:5255
 set_one_prio+0x1cb/0x270 kernel/sys.c:202
 __do_sys_setpriority kernel/sys.c:243 [inline]
 __se_sys_setpriority+0x2ee/0x750 kernel/sys.c:207
 __x64_sys_setpriority+0x7b/0x90 kernel/sys.c:207
 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f87d70288c9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f87d6fda318 EFLAGS: 00000246 ORIG_RAX: 000000000000008d
RAX: ffffffffffffffda RBX: 00007f87d70b03e8 RCX: 00007f87d70288c9
RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000001
RBP: 00007f87d70b03e0 R08: 00007f87d6fda700 R09: 0000000000000000
R10: 00007f87d6fda700 R11: 0000000000000246 R12: 00007f87d70b03ec
R13: 00007ffe0f7848ef R14: 00007f87d6fda400 R15: 0000000000022000
Modules linked in:
---[ end trace 72d1249a48ac3502 ]---
RIP: 0010:dequeue_load_avg kernel/sched/fair.c:3095 [inline]
RIP: 0010:reweight_entity+0x110/0x510 kernel/sched/fair.c:3114
Code: 80 3c 08 00 74 08 48 89 df e8 0c 3c 5a 00 48 89 5d 88 4c 8b 3b 4c 89 e8 48 c1 e8 03 48 89 45 b0 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 ef e8 e2 3b 5a 00 49 8b 45 00 31 db 4c 29
RSP: 0018:ffffc90000c17c10 EFLAGS: 00010006
RAX: 0000000000000014 RBX: ffff888112bae4e0 RCX: dffffc0000000000
RDX: 0000000000044000 RSI: ffff888112bae340 RDI: 0000000000000000
RBP: ffffc90000c17ca8 R08: ffffffff86e40048 R09: ffffffff86e40058
R10: ffffffff86e40050 R11: ffffffff86e40043 R12: 0000000000000000
R13: 00000000000000a0 R14: ffff888112bae340 R15: 0000000000000400
FS:  00007f87d6fda700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f87d707daa8 CR3: 00000001161a9000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	80 3c 08 00          	cmpb   $0x0,(%rax,%rcx,1)
   4:	74 08                	je     0xe
   6:	48 89 df             	mov    %rbx,%rdi
   9:	e8 0c 3c 5a 00       	callq  0x5a3c1a
   e:	48 89 5d 88          	mov    %rbx,-0x78(%rbp)
  12:	4c 8b 3b             	mov    (%rbx),%r15
  15:	4c 89 e8             	mov    %r13,%rax
  18:	48 c1 e8 03          	shr    $0x3,%rax
  1c:	48 89 45 b0          	mov    %rax,-0x50(%rbp)
  20:	48 b9 00 00 00 00 00 	movabs $0xdffffc0000000000,%rcx
  27:	fc ff df
* 2a:	80 3c 08 00          	cmpb   $0x0,(%rax,%rcx,1) <-- trapping instruction
  2e:	74 08                	je     0x38
  30:	4c 89 ef             	mov    %r13,%rdi
  33:	e8 e2 3b 5a 00       	callq  0x5a3c1a
  38:	49 8b 45 00          	mov    0x0(%r13),%rax
  3c:	31 db                	xor    %ebx,%ebx
  3e:	4c                   	rex.WR
  3f:	29                   	.byte 0x29

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/02/13 15:46 android12-5.10-lts 86e6176a4240 8b9ca619 .config console log report syz C ci2-android-5-10 general protection fault in reweight_entity
2021/12/17 17:36 android12-5.10-lts afc997898ece 44068e19 .config console log report syz C ci2-android-5-10 general protection fault in reweight_entity
* Struck through repros no longer work on HEAD.