syzbot


general protection fault in kvm_lapic_hv_timer_in_use

Status: fixed on 2019/04/02 11:50
Subsystems: kvm
[Documentation on labels]
Reported-by: syzbot+1c69d94fe42901b029c1@syzkaller.appspotmail.com
Fix commit: 26b471c7e2f7 KVM: nVMX: Fix bad cleanup on error of get/set nested state IOCTLs
First crash: 2253d, last: 2206d
Cause bisection: introduced by (bisect log) :
commit 8fcc4b5923af5de58b80b53a069453b135693304
Author: Jim Mattson <jmattson@google.com>
Date: Tue Jul 10 09:27:20 2018 +0000

  kvm: nVMX: Introduce KVM_CAP_NESTED_STATE

Crash: KASAN: use-after-free Read in finish_task_switch (log)
Repro: syz .config
  
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
general protection fault in __schedule (2) kernel C done done 1712 2205d 2249d 0/28 closed as dup on 2019/11/22 20:54
Discussions (1)
Title Replies (including bot) Last reply
general protection fault in kvm_lapic_hv_timer_in_use 1 (4) 2019/04/01 19:58

Sample crash report:
RBP: 000000000072c040 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000072c04c
R13: 00007ffc0845277f R14: 00007f1c1a1f89c0 R15: 0000000000000002
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5601 Comm: syz-executor0 Not tainted 4.19.0-rc4+ #248
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:kvm_lapic_hv_timer_in_use+0x56/0xd0 arch/x86/kvm/lapic.c:1622
Code: c1 ea 03 80 3c 02 00 75 7a 48 8b 9b e0 03 00 00 e8 cf 7a 66 00 48 8d 7b 7c 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 04 84 c0 75 51 0f b6 5b 7c
RSP: 0018:ffff8801b8d0f098 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff810f00fe
RDX: 000000000000000f RSI: ffffffff811859b1 RDI: 000000000000007c
RBP: ffff8801b8d0f0a0 R08: ffff8801d1ea60c0 R09: ffffed00371cfb6c
R10: ffffed00371cfb6c R11: ffff8801b8e7db67 R12: 0000000000000001
R13: 1ffff100371a1e1a R14: 0000000000000000 R15: ffff8801b8e78060
FS:  00007f1c1a1f8700(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f63d064f000 CR3: 00000001c23f2000 CR4: 00000000001426e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 kvm_arch_vcpu_load+0x516/0x970 arch/x86/kvm/x86.c:3128
 kvm_sched_in+0x82/0xa0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3975
 __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+0x56e/0x900 kernel/sched/core.c:2679
 context_switch kernel/sched/core.c:2828 [inline]
 __schedule+0x874/0x1ed0 kernel/sched/core.c:3473
 preempt_schedule_common+0x1f/0xd0 kernel/sched/core.c:3597
 preempt_schedule+0x4d/0x60 kernel/sched/core.c:3623
 ___preempt_schedule+0x16/0x18
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
 _raw_spin_unlock_irqrestore+0xbb/0xd0 kernel/locking/spinlock.c:184
 try_to_wake_up+0x10a/0x12f0 kernel/sched/core.c:2055
 wake_up_process kernel/sched/core.c:2123 [inline]
 wake_up_q+0xa4/0x100 kernel/sched/core.c:441
 futex_wake+0x61f/0x760 kernel/futex.c:1556
 do_futex+0x2e4/0x26d0 kernel/futex.c:3533
 __do_sys_futex kernel/futex.c:3589 [inline]
 __se_sys_futex kernel/futex.c:3557 [inline]
 __x64_sys_futex+0x472/0x6a0 kernel/futex.c:3557
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457679
Code: 1d 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 eb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f1c1a1f7cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 000000000072c048 RCX: 0000000000457679
RDX: 0000000000000016 RSI: 0000000000000081 RDI: 000000000072c04c
RBP: 000000000072c040 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000072c04c
R13: 00007ffc0845277f R14: 00007f1c1a1f89c0 R15: 0000000000000002
Modules linked in:
---[ end trace 107e9054540c67ea ]---
RIP: 0010:kvm_lapic_hv_timer_in_use+0x56/0xd0 arch/x86/kvm/lapic.c:1622
Code: c1 ea 03 80 3c 02 00 75 7a 48 8b 9b e0 03 00 00 e8 cf 7a 66 00 48 8d 7b 7c 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 04 84 c0 75 51 0f b6 5b 7c
RSP: 0018:ffff8801b8d0f098 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff810f00fe
RDX: 000000000000000f RSI: ffffffff811859b1 RDI: 000000000000007c
RBP: ffff8801b8d0f0a0 R08: ffff8801d1ea60c0 R09: ffffed00371cfb6c
R10: ffffed00371cfb6c R11: ffff8801b8e7db67 R12: 0000000000000001
R13: 1ffff100371a1e1a R14: 0000000000000000 R15: ffff8801b8e78060
FS:  00007f1c1a1f8700(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f63d064f000 CR3: 00000001c23f2000 CR4: 00000000001426e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (205):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/09/21 14:43 upstream 234b69e3e089 37079712 .config console log report syz ci-upstream-kasan-gce-root
2018/09/21 20:30 upstream 234b69e3e089 37079712 .config console log report ci-upstream-kasan-gce
2018/09/21 17:04 upstream 234b69e3e089 37079712 .config console log report ci-upstream-kasan-gce-selinux-root
2018/09/21 09:28 upstream 234b69e3e089 37079712 .config console log report ci-upstream-kasan-gce-root
2018/09/21 03:39 upstream ae596de1a0c8 6cee973c .config console log report ci-upstream-kasan-gce-selinux-root
2018/09/20 21:15 upstream ae596de1a0c8 6cee973c .config console log report ci-upstream-kasan-gce-selinux-root
2018/09/20 15:08 upstream eb9a29f9e585 565a5452 .config console log report ci-upstream-kasan-gce
2018/09/12 22:50 upstream 96eddb810b14 71907daf .config console log report ci-upstream-kasan-gce-smack-root
2018/09/10 04:34 upstream 9a5682765a2e 6b5120a4 .config console log report ci-upstream-kasan-gce-root
2018/09/10 02:07 upstream 9a5682765a2e 6b5120a4 .config console log report ci-upstream-kasan-gce-smack-root
2018/09/09 20:32 upstream 9a5682765a2e 6b5120a4 .config console log report ci-upstream-kasan-gce-root
2018/09/09 12:25 upstream f8f65382c98a 6b5120a4 .config console log report ci-upstream-kasan-gce
2018/09/09 01:26 upstream d7b686ebf704 6b5120a4 .config console log report ci-upstream-kasan-gce
2018/09/08 09:40 upstream 3d0e7a9e00fd 6b5120a4 .config console log report ci-upstream-kasan-gce-root
2018/09/08 08:23 upstream 3d0e7a9e00fd 6b5120a4 .config console log report ci-upstream-kasan-gce-selinux-root
2018/09/07 23:21 upstream a49a9dcce802 69cfeb80 .config console log report ci-upstream-kasan-gce-root
2018/09/07 17:55 upstream a49a9dcce802 69cfeb80 .config console log report ci-upstream-kasan-gce
2018/09/07 15:43 upstream a49a9dcce802 69cfeb80 .config console log report ci-upstream-kasan-gce-smack-root
2018/09/07 09:23 upstream ca16eb342ebe e30d3b52 .config console log report ci-upstream-kasan-gce-root
2018/09/07 07:32 upstream ca16eb342ebe e30d3b52 .config console log report ci-upstream-kasan-gce
2018/09/07 05:57 upstream ca16eb342ebe e30d3b52 .config console log report ci-upstream-kasan-gce
2018/09/07 04:45 upstream ca16eb342ebe e30d3b52 .config console log report ci-upstream-kasan-gce-selinux-root
2018/09/07 01:15 upstream ca16eb342ebe e30d3b52 .config console log report ci-upstream-kasan-gce
2018/09/06 12:34 upstream b36fdc6853a3 0bb7a7eb .config console log report ci-upstream-kasan-gce-root
2018/09/20 16:22 upstream eb9a29f9e585 565a5452 .config console log report ci-upstream-kasan-gce-386
2018/09/18 18:40 upstream 5211da9ca526 7f125108 .config console log report ci-upstream-kasan-gce-386
2018/09/18 00:39 upstream 3918c21eacb0 7f125108 .config console log report ci-upstream-kasan-gce-386
2018/09/17 18:35 upstream c0747ad363ff 7f125108 .config console log report ci-upstream-kasan-gce-386
2018/09/17 07:13 upstream 7876320f8880 a343a400 .config console log report ci-upstream-kasan-gce-386
2018/09/16 17:56 upstream 27c5a778dfe2 a343a400 .config console log report ci-upstream-kasan-gce-386
2018/09/15 04:01 upstream 090b75bcba62 a343a400 .config console log report ci-upstream-kasan-gce-386
2018/09/13 23:53 upstream 54eda9df17f3 19e9088b .config console log report ci-upstream-kasan-gce-386
2018/09/13 03:27 upstream 96eddb810b14 71907daf .config console log report ci-upstream-kasan-gce-386
2018/09/12 01:36 upstream 11da3a7f84f1 4ae17b1f .config console log report ci-upstream-kasan-gce-386
2018/09/11 06:35 upstream 11da3a7f84f1 8c88323f .config console log report ci-upstream-kasan-gce-386
2018/09/10 22:33 upstream 11da3a7f84f1 f167cb6b .config console log report ci-upstream-kasan-gce-386
2018/09/09 03:25 upstream d7b686ebf704 6b5120a4 .config console log report ci-upstream-kasan-gce-386
2018/09/06 16:40 upstream b36fdc6853a3 0bb7a7eb .config console log report ci-upstream-kasan-gce-386
2018/09/22 09:27 linux-next 46c163a036b4 37079712 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/22 00:46 linux-next 46c163a036b4 37079712 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/21 22:27 linux-next 46c163a036b4 37079712 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/21 18:50 linux-next 46c163a036b4 37079712 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/20 22:29 linux-next a0cb0cabe4bb 6cee973c .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/08 16:14 linux-next f2b6e66e9885 6b5120a4 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/08 11:44 linux-next f2b6e66e9885 6b5120a4 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/08/07 02:33 linux-next 8c8399e0a3fb 1beb8136 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.