general protection fault in reweight_entity

18 views
Skip to first unread message

syzbot

unread,
Dec 17, 2021, 12:37:24 PM12/17/21
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: afc997898ece Merge 5.10.85 into android12-5.10-lts
git tree: android12-5.10-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=16498b6db00000
kernel config: https://syzkaller.appspot.com/x/.config?x=977f5eaa96dd4962
dashboard link: https://syzkaller.appspot.com/bug?extid=af7a719bc92395ee41b3
compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11a44dcbb00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=129d91cdb00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+af7a71...@syzkaller.appspotmail.com

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: 18991 Comm: syz-executor667 Not tainted 5.10.85-syzkaller-00573-gafc997898ece #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:dequeue_load_avg kernel/sched/fair.c:3095 [inline] kernel/sched/fair.c:3114
RIP: 0010:reweight_entity+0x110/0x510 kernel/sched/fair.c:3114 kernel/sched/fair.c:3114
Code: 80 3c 08 00 74 08 48 89 df e8 3c ff 59 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 12 ff 59 00 49 8b 45 00 31 db 4c 29
RSP: 0018:ffffc900029d7c10 EFLAGS: 00010006
RAX: 0000000000000014 RBX: ffff88810c1a3d60 RCX: dffffc0000000000
RDX: 0000000000003c00 RSI: ffff88810c1a3bc0 RDI: 0000000000000000
RBP: ffffc900029d7ca8 R08: ffffffff86e42048 R09: ffffffff86e42058
R10: ffffffff86e42050 R11: ffffffff86e42043 R12: 0000000000000000
R13: 00000000000000a0 R14: ffff88810c1a3bc0 R15: 0000000000000400
FS: 00007f1789e63700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fffcef4b7c0 CR3: 000000010c3aa000 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 kernel/sched/fair.c:3139
set_load_weight kernel/sched/core.c:902 [inline]
set_load_weight kernel/sched/core.c:902 [inline] kernel/sched/core.c:5255
set_user_nice+0x516/0xed0 kernel/sched/core.c:5255 kernel/sched/core.c:5255
set_one_prio+0x1cb/0x270 kernel/sys.c:202 kernel/sys.c:202
__do_sys_setpriority kernel/sys.c:243 [inline]
__do_sys_setpriority kernel/sys.c:243 [inline] kernel/sys.c:207
__se_sys_setpriority+0x2ee/0x750 kernel/sys.c:207 kernel/sys.c:207
__x64_sys_setpriority+0x7b/0x90 kernel/sys.c:207 kernel/sys.c:207
do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f1789eb18c9
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:00007f1789e63318 EFLAGS: 00000246 ORIG_RAX: 000000000000008d
RAX: ffffffffffffffda RBX: 00007f1789f393e8 RCX: 00007f1789eb18c9
RDX: 0000000000008f82 RSI: 0000000000000000 RDI: 0000000000000001
RBP: 00007f1789f393e0 R08: 00007f1789e63700 R09: 0000000000000000
R10: 00007f1789e63700 R11: 0000000000000246 R12: 00007f1789f393ec
R13: 00007fffcef3ecaf R14: 00007f1789e63400 R15: 0000000000022000
Modules linked in:
---[ end trace 0e948288e9716314 ]---
RIP: 0010:dequeue_load_avg kernel/sched/fair.c:3095 [inline]
RIP: 0010:dequeue_load_avg kernel/sched/fair.c:3095 [inline] kernel/sched/fair.c:3114
RIP: 0010:reweight_entity+0x110/0x510 kernel/sched/fair.c:3114 kernel/sched/fair.c:3114
Code: 80 3c 08 00 74 08 48 89 df e8 3c ff 59 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 12 ff 59 00 49 8b 45 00 31 db 4c 29
RSP: 0018:ffffc900029d7c10 EFLAGS: 00010006
RAX: 0000000000000014 RBX: ffff88810c1a3d60 RCX: dffffc0000000000
RDX: 0000000000003c00 RSI: ffff88810c1a3bc0 RDI: 0000000000000000
RBP: ffffc900029d7ca8 R08: ffffffff86e42048 R09: ffffffff86e42058
R10: ffffffff86e42050 R11: ffffffff86e42043 R12: 0000000000000000
R13: 00000000000000a0 R14: ffff88810c1a3bc0 R15: 0000000000000400
FS: 00007f1789e63700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fffcef4b7c0 CR3: 000000010c3aa000 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 3c ff 59 00 callq 0x59ff4a
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 12 ff 59 00 callq 0x59ff4a
38: 49 8b 45 00 mov 0x0(%r13),%rax
3c: 31 db xor %ebx,%ebx
3e: 4c rex.WR
3f: 29 .byte 0x29
----------------
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 3c ff 59 00 callq 0x59ff4a
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 12 ff 59 00 callq 0x59ff4a
38: 49 8b 45 00 mov 0x0(%r13),%rax
3c: 31 db xor %ebx,%ebx
3e: 4c rex.WR
3f: 29 .byte 0x29


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Dec 17, 2021, 3:17:12 PM12/17/21
to syzkaller-a...@googlegroups.com
syzbot has bisected this issue to:

commit c85c6fadbef0a3eab41540ea628fa8fe8928c820
Author: Zhang Qiao <zhang...@huawei.com>
Date: Wed Sep 15 06:40:30 2021 +0000

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

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=15c39933b00000
start commit: afc997898ece Merge 5.10.85 into android12-5.10-lts
git tree: android12-5.10-lts
final oops: https://syzkaller.appspot.com/x/report.txt?x=17c39933b00000
console output: https://syzkaller.appspot.com/x/log.txt?x=13c39933b00000
Reported-by: syzbot+af7a71...@syzkaller.appspotmail.com
Fixes: c85c6fadbef0 ("kernel/sched: Fix sched_fork() access an invalid sched_task_group")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Tadeusz Struk

unread,
Feb 16, 2022, 1:53:24 PM2/16/22
to syzkaller-android-bugs

syzbot

unread,
Feb 16, 2022, 3:18:11 PM2/16/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
general protection fault in reweight_entity

general protection fault, probably for non-canonical address 0xdffffc0000000014: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000000a0-0x00000000000000a7]
CPU: 0 PID: 1783 Comm: syz-executor364 Not tainted 5.10.81-syzkaller-00042-gc3daae52afbc #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 bc 1a 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 92 1a 5a 00 49 8b 45 00 31 db 4c 29
RSP: 0018:ffffc90003a57c10 EFLAGS: 00010006
RAX: 0000000000000014 RBX: ffff88810ef30220 RCX: dffffc0000000000
RDX: 0000000000044000 RSI: ffff88810ef30080 RDI: 0000000000000000
RBP: ffffc90003a57ca8 R08: ffffffff86a42008 R09: ffffffff86a42018
R10: ffffffff86a42010 R11: ffffffff86a42003 R12: 0000000000000000
R13: 00000000000000a0 R14: ffff88810ef30080 R15: 0000000000000400
FS: 00007f12de518700(0000) GS:ffff8881f7200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff684cb7c0 CR3: 000000010ecd0000 CR4: 00000000003506b0
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:0x7f12de5668b9
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:00007f12de518318 EFLAGS: 00000246 ORIG_RAX: 000000000000008d
RAX: ffffffffffffffda RBX: 00007f12de5ee3e8 RCX: 00007f12de5668b9
RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000001
RBP: 00007f12de5ee3e0 R08: 00007f12de518700 R09: 0000000000000000
R10: 00007f12de518700 R11: 0000000000000246 R12: 00007f12de5ee3ec
R13: 00007fff684655df R14: 00007f12de518400 R15: 0000000000022000
Modules linked in:
---[ end trace d78747da9962ad42 ]---
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 bc 1a 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 92 1a 5a 00 49 8b 45 00 31 db 4c 29
RSP: 0018:ffffc90003a57c10 EFLAGS: 00010006
RAX: 0000000000000014 RBX: ffff88810ef30220 RCX: dffffc0000000000
RDX: 0000000000044000 RSI: ffff88810ef30080 RDI: 0000000000000000
RBP: ffffc90003a57ca8 R08: ffffffff86a42008 R09: ffffffff86a42018
R10: ffffffff86a42010 R11: ffffffff86a42003 R12: 0000000000000000
R13: 00000000000000a0 R14: ffff88810ef30080 R15: 0000000000000400
FS: 00007f12de518700(0000) GS:ffff8881f7200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff684cb7c0 CR3: 000000010ecd0000 CR4: 00000000003506b0
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 bc 1a 5a 00 callq 0x5a1aca
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 92 1a 5a 00 callq 0x5a1aca
38: 49 8b 45 00 mov 0x0(%r13),%rax
3c: 31 db xor %ebx,%ebx
3e: 4c rex.WR
3f: 29 .byte 0x29


Tested on:

commit: c3daae52 UPSTREAM: rcu/exp: Mark current CPU as exp-QS..
git tree: https://android.googlesource.com/kernel/common android12-5.10
console output: https://syzkaller.appspot.com/x/log.txt?x=11e157bc700000
kernel config: https://syzkaller.appspot.com/x/.config?x=c346f7c7af5fc789
dashboard link: https://syzkaller.appspot.com/bug?extid=af7a719bc92395ee41b3
compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.

syzbot

unread,
Feb 18, 2022, 4:31:12 PM2/18/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+af7a71...@syzkaller.appspotmail.com

Tested on:

commit: cd5f87fa FROMGIT: regmap-irq: Update interrupt clear r..
kernel config: https://syzkaller.appspot.com/x/.config?x=c346f7c7af5fc789
dashboard link: https://syzkaller.appspot.com/bug?extid=af7a719bc92395ee41b3
compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages