general protection fault in finish_task_switch (2)

27 views
Skip to first unread message

syzbot

unread,
Aug 10, 2018, 10:42:04 AM8/10/18
to h...@zytor.com, k...@vger.kernel.org, linux-...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, rkr...@redhat.com, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
Hello,

syzbot found the following crash on:

HEAD commit: 8c8399e0a3fb Add linux-next specific files for 20180806
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=16c6b8e2400000
kernel config: https://syzkaller.appspot.com/x/.config?x=1b6bc1781e49e93e
dashboard link: https://syzkaller.appspot.com/bug?extid=1f56df64bfb3c29dde6f
compiler: gcc (GCC) 8.0.1 20180413 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

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

kasan: CONFIG_KASAN_INLINE enabled
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
vmwrite_error+0x4c/0x60 arch/x86/kvm/vmx.c:2201
CPU: 0 PID: 9256 Comm: syz-executor2 Not tainted 4.18.0-rc8-next-20180806+
#32
__vmcs_writel arch/x86/kvm/vmx.c:2211 [inline]
vmcs_writel arch/x86/kvm/vmx.c:2251 [inline]
vmx_vcpu_load+0xcdb/0xfe0 arch/x86/kvm/vmx.c:2917
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:__fire_sched_in_preempt_notifiers kernel/sched/core.c:2481
[inline]
RIP: 0010:fire_sched_in_preempt_notifiers kernel/sched/core.c:2487 [inline]
RIP: 0010:finish_task_switch+0x538/0x870 kernel/sched/core.c:2679
Code: 89 e1 48 c1 e9 03 42 80 3c 39 00 0f 85 ab 01 00 00 4d 8b 24 24 4d 85
e4 0f 84 e3 fc ff ff 49 8d 7c 24 10 48 89 f9 48 c1 e9 03 <42> 80 3c 39 00
74 a5 e8 1c e8 67 00 eb 9e 80 3d 80 e4 31 07 00 0f
RSP: 0018:ffff8801977a7980 EFLAGS: 00010a06
RAX: 0000000000000000 RBX: ffff8801db02ca40 RCX: 1bd5a00000000022
RDX: 0000000000040000 RSI: ffffffff810edd32 RDI: dead000000000110
RBP: ffff8801977a7a68 R08: ffff88019386a080 R09: fffffbfff1107d28
R10: fffffbfff1107d28 R11: 0000000000000003 R12: dead000000000100
kvm_arch_vcpu_load+0x22b/0x940 arch/x86/kvm/x86.c:3081
R13: ffff88019549c240 R14: 0000000000000000 R15: dffffc0000000000
FS: 00007fd2dc8cf700(0000) GS:ffff8801db000000(0000) knlGS:0000000000000000
kvm_sched_in+0x82/0xa0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3975
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
__fire_sched_in_preempt_notifiers kernel/sched/core.c:2481 [inline]
fire_sched_in_preempt_notifiers kernel/sched/core.c:2487 [inline]
finish_task_switch+0x50d/0x870 kernel/sched/core.c:2679
CR2: 0000001b2fb21000 CR3: 0000000190863000 CR4: 00000000001426f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
context_switch kernel/sched/core.c:2826 [inline]
__schedule+0x884/0x1ec0 kernel/sched/core.c:3471
context_switch kernel/sched/core.c:2826 [inline]
__schedule+0x884/0x1ec0 kernel/sched/core.c:3471
preempt_schedule_common+0x22/0x60 kernel/sched/core.c:3595
schedule+0xfb/0x450 kernel/sched/core.c:3515
_cond_resched+0x1d/0x30 kernel/sched/core.c:4961
__mutex_lock_common kernel/locking/mutex.c:908 [inline]
__mutex_lock+0x13d/0x1700 kernel/locking/mutex.c:1073
exit_to_usermode_loop+0x22f/0x380 arch/x86/entry/common.c:152
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x456cb9
Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fd2dc8cecf8 EFLAGS: 00000246
ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 0000000000930148 RCX: 0000000000456cb9
RDX: 0000000000000016 RSI: 0000000000000001 RDI: 000000000093014c
RBP: 0000000000930140 R08: 0000000000000000 R09: 0000000000000000
mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1088
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000093014c
R13: 00007ffd09c12e5f R14: 00007fd2dc8cf9c0 R15: 0000000000000001
arch_jump_label_transform+0x1b/0x40 arch/x86/kernel/jump_label.c:112
Modules linked in:
__jump_label_update+0x16e/0x1a0 kernel/jump_label.c:375
jump_label_update+0x151/0x2e0 kernel/jump_label.c:760
Dumping ftrace buffer:
static_key_slow_inc_cpuslocked+0x341/0x430 kernel/jump_label.c:110
(ftrace buffer empty)
---[ end trace de1ac742ecfe90a2 ]---
RIP: 0010:__fire_sched_in_preempt_notifiers kernel/sched/core.c:2481
[inline]
RIP: 0010:fire_sched_in_preempt_notifiers kernel/sched/core.c:2487 [inline]
RIP: 0010:finish_task_switch+0x538/0x870 kernel/sched/core.c:2679
Code: 89 e1 48 c1 e9 03 42 80 3c 39 00 0f 85 ab 01 00 00 4d 8b 24 24 4d 85
e4 0f 84 e3 fc ff ff 49 8d 7c 24 10 48 89 f9 48 c1 e9 03 <42> 80 3c 39 00
74 a5 e8 1c e8 67 00 eb 9e 80 3d 80 e4 31 07 00 0f
RSP: 0018:ffff8801977a7980 EFLAGS: 00010a06
static_key_slow_inc+0x1a/0x30 kernel/jump_label.c:125
kvm_arch_vcpu_init+0x300/0x830 arch/x86/kvm/x86.c:8710
kvm_vcpu_init+0x2fb/0x420 arch/x86/kvm/../../../virt/kvm/kvm_main.c:317
RAX: 0000000000000000 RBX: ffff8801db02ca40 RCX: 1bd5a00000000022
vmx_create_vcpu+0x14c/0x2980 arch/x86/kvm/vmx.c:10665
RDX: 0000000000040000 RSI: ffffffff810edd32 RDI: dead000000000110
RBP: ffff8801977a7a68 R08: ffff88019386a080 R09: fffffbfff1107d28
R10: fffffbfff1107d28 R11: 0000000000000003 R12: dead000000000100
R13: ffff88019549c240 R14: 0000000000000000 R15: dffffc0000000000
FS: 00007fd2dc8cf700(0000) GS:ffff8801db000000(0000) knlGS:0000000000000000
kvm_arch_vcpu_create+0xe5/0x220 arch/x86/kvm/x86.c:8398
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:2476
[inline]
kvm_vm_ioctl+0x488/0x1d80 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2977
CR2: 0000001b2fb21000 CR3: 0000000190863000 CR4: 00000000001426f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.

syzbot

unread,
Aug 21, 2018, 5:28:04 PM8/21/18
to dvh...@infradead.org, h...@zytor.com, k...@vger.kernel.org, linux-...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, pet...@infradead.org, rkr...@redhat.com, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
syzbot has found a reproducer for the following crash on:

HEAD commit: 778a33959a8a Merge tag 'please-pull-noboot' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14a5385a400000
kernel config: https://syzkaller.appspot.com/x/.config?x=214e4990bd49329f
dashboard link: https://syzkaller.appspot.com/bug?extid=1f56df64bfb3c29dde6f
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
userspace arch: i386
syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=13ffa561400000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10023961400000

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

random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and
https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html for details.
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
CPU: 0 PID: 4489 Comm: syz-executor233 Not tainted 4.18.0+ #103
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:__fire_sched_in_preempt_notifiers kernel/sched/core.c:2481
[inline]
RIP: 0010:fire_sched_in_preempt_notifiers kernel/sched/core.c:2487 [inline]
RIP: 0010:finish_task_switch+0x538/0x870 kernel/sched/core.c:2679
Code: 89 e1 48 c1 e9 03 42 80 3c 39 00 0f 85 ab 01 00 00 4d 8b 24 24 4d 85
e4 0f 84 e3 fc ff ff 49 8d 7c 24 10 48 89 f9 48 c1 e9 03 <42> 80 3c 39 00
74 a5 e8 8c a5 67 00 eb 9e 80 3d 8b c3 32 07 00 0f
RSP: 0018:ffff8801ac0ff058 EFLAGS: 00010a06
RAX: 0000000000000000 RBX: ffff8801db02cc40 RCX: 1bd5a00000000022
RDX: 0000000000000000 RSI: ffffffff810ed162 RDI: dead000000000110
RBP: ffff8801ac0ff140 R08: ffff8801acb8c300 R09: ffffed003b221b6c
R10: ffffed003b221b6c R11: ffff8801d910db67 R12: dead000000000100
R13: ffff8801ca5e0040 R14: 0000000000000000 R15: dffffc0000000000
FS: 0000000000000000(0000) GS:ffff8801db000000(0063) knlGS:00000000f7f07b40
CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00007f1304e0b000 CR3: 00000001acab3000 CR4: 00000000001426f0
Call Trace:
context_switch kernel/sched/core.c:2826 [inline]
__schedule+0x884/0x1df0 kernel/sched/core.c:3471
schedule+0xfb/0x450 kernel/sched/core.c:3515
freezable_schedule include/linux/freezer.h:172 [inline]
futex_wait_queue_me+0x3f9/0x840 kernel/futex.c:2530
futex_wait+0x45b/0xa20 kernel/futex.c:2645
do_futex+0x336/0x27d0 kernel/futex.c:3527
__do_compat_sys_futex kernel/futex_compat.c:201 [inline]
__se_compat_sys_futex kernel/futex_compat.c:175 [inline]
__ia32_compat_sys_futex+0x3d9/0x5f0 kernel/futex_compat.c:175
do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline]
do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397
entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7f0bca9
Code: 55 08 8b 88 64 cd ff ff 8b 98 68 cd ff ff 89 c8 85 d2 74 02 89 0a 5b
5d c3 8b 04 24 c3 8b 1c 24 c3 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90
90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 002b:00000000f7f071ec EFLAGS: 00000296 ORIG_RAX: 00000000000000f0
RAX: ffffffffffffffda RBX: 00000000080fb008 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00000000c080aebe R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
Dumping ftrace buffer:
(ftrace buffer empty)
---[ end trace a4bb2f1beb6735f0 ]---
RIP: 0010:__fire_sched_in_preempt_notifiers kernel/sched/core.c:2481
[inline]
RIP: 0010:fire_sched_in_preempt_notifiers kernel/sched/core.c:2487 [inline]
RIP: 0010:finish_task_switch+0x538/0x870 kernel/sched/core.c:2679
Code: 89 e1 48 c1 e9 03 42 80 3c 39 00 0f 85 ab 01 00 00 4d 8b 24 24 4d 85
e4 0f 84 e3 fc ff ff 49 8d 7c 24 10 48 89 f9 48 c1 e9 03 <42> 80 3c 39 00
74 a5 e8 8c a5 67 00 eb 9e 80 3d 8b c3 32 07 00 0f
RSP: 0018:ffff8801ac0ff058 EFLAGS: 00010a06
RAX: 0000000000000000 RBX: ffff8801db02cc40 RCX: 1bd5a00000000022
RDX: 0000000000000000 RSI: ffffffff810ed162 RDI: dead000000000110
RBP: ffff8801ac0ff140 R08: ffff8801acb8c300 R09: ffffed003b221b6c
R10: ffffed003b221b6c R11: ffff8801d910db67 R12: dead000000000100
R13: ffff8801ca5e0040 R14: 0000000000000000 R15: dffffc0000000000
FS: 0000000000000000(0000) GS:ffff8801db000000(0063) knlGS:00000000f7f07b40
CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00007f1304e0b000 CR3: 00000001acab3000 CR4: 00000000001426f0

Peter Zijlstra

unread,
Aug 22, 2018, 5:08:31 AM8/22/18
to syzbot, dvh...@infradead.org, h...@zytor.com, k...@vger.kernel.org, linux-...@vger.kernel.org, mi...@redhat.com, pbon...@redhat.com, rkr...@redhat.com, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
On Tue, Aug 21, 2018 at 02:28:02PM -0700, syzbot wrote:
> syzbot has found a reproducer for the following crash on:
>
> HEAD commit: 778a33959a8a Merge tag 'please-pull-noboot' of git://git.k..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=14a5385a400000
> kernel config: https://syzkaller.appspot.com/x/.config?x=214e4990bd49329f
> dashboard link: https://syzkaller.appspot.com/bug?extid=1f56df64bfb3c29dde6f
> compiler: gcc (GCC) 8.0.1 20180413 (experimental)
> userspace arch: i386
> syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=13ffa561400000

FWIW the lack of whitespace between "repro:" and the URL makes it hard
to copy paste.

> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10023961400000


> RIP: 0010:__fire_sched_in_preempt_notifiers kernel/sched/core.c:2481

That repro thing does something dodgy with KVM, which then corrupts the
premption notifier thing. I'm sufficiently KVM clueless to not really
know where to start looking though..

Paolo Bonzini

unread,
Aug 22, 2018, 5:22:12 AM8/22/18
to Peter Zijlstra, syzbot, dvh...@infradead.org, h...@zytor.com, k...@vger.kernel.org, linux-...@vger.kernel.org, mi...@redhat.com, rkr...@redhat.com, syzkall...@googlegroups.com, tg...@linutronix.de, x...@kernel.org
On 22/08/2018 11:08, Peter Zijlstra wrote:
>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10023961400000
>
>> RIP: 0010:__fire_sched_in_preempt_notifiers kernel/sched/core.c:2481
> That repro thing does something dodgy with KVM, which then corrupts the
> premption notifier thing. I'm sufficiently KVM clueless to not really
> know where to start looking though..

It seems to be a reference counting issue, or something like that. I'm
looking at it...

Paolo

Dmitry Vyukov

unread,
Aug 24, 2018, 4:16:29 PM8/24/18
to Peter Zijlstra, syzbot, Darren Hart, H. Peter Anvin, KVM list, LKML, Ingo Molnar, Paolo Bonzini, Radim Krčmář, syzkaller-bugs, Thomas Gleixner, the arch/x86 maintainers
On Wed, Aug 22, 2018 at 2:08 AM, Peter Zijlstra <pet...@infradead.org> wrote:
> On Tue, Aug 21, 2018 at 02:28:02PM -0700, syzbot wrote:
>> syzbot has found a reproducer for the following crash on:
>>
>> HEAD commit: 778a33959a8a Merge tag 'please-pull-noboot' of git://git.k..
>> git tree: upstream
>> console output: https://syzkaller.appspot.com/x/log.txt?x=14a5385a400000
>> kernel config: https://syzkaller.appspot.com/x/.config?x=214e4990bd49329f
>> dashboard link: https://syzkaller.appspot.com/bug?extid=1f56df64bfb3c29dde6f
>> compiler: gcc (GCC) 8.0.1 20180413 (experimental)
>> userspace arch: i386
>> syzkaller repro:https://syzkaller.appspot.com/x/repro.syz?x=13ffa561400000
>
> FWIW the lack of whitespace between "repro:" and the URL makes it hard
> to copy paste.

Fixed by:
https://github.com/google/syzkaller/commit/307deaee5e23e4585d4b408ebcf329b9dc8ebdb4
Thanks

Eric Biggers

unread,
Aug 22, 2019, 8:12:44 PM8/22/19
to syzbot, syzkall...@googlegroups.com
On Tue, Aug 21, 2018 at 02:28:02PM -0700, syzbot wrote:
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bug...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/0000000000006e87360573f8b328%40google.com.
> For more options, visit https://groups.google.com/d/optout.

#syz fix: KVM: nVMX: Fix bad cleanup on error of get/set nested state IOCTLs
Reply all
Reply to author
Forward
0 new messages