linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kernel BUG at arch/x86/kvm/x86.c:LINE! (2)
@ 2018-10-10  7:52 syzbot
  2018-10-10 12:33 ` syzbot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: syzbot @ 2018-10-10  7:52 UTC (permalink / raw)
  To: bp, hpa, kvm, linux-kernel, mingo, pbonzini, rkrcmar,
	syzkaller-bugs, tglx, x86

Hello,

syzbot found the following crash on:

HEAD commit:    64c5e530ac2c Merge tag 'arc-4.19-rc8' of git://git.kernel...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=167a4e85400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=88e9a8a39dc0be2d
dashboard link: https://syzkaller.appspot.com/bug?extid=f9b42efadea9f5453100
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
userspace arch: i386

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+f9b42efadea9f5453100@syzkaller.appspotmail.com

Use struct sctp_sack_info instead
sctp: [Deprecated]: syz-executor0 (pid 11077) Use of struct  
sctp_assoc_value in delayed_ack socket option.
Use struct sctp_sack_info instead
audit: type=1326 audit(1539141761.977:32): auid=4294967295 uid=0 gid=0  
ses=4294967295 subj==unconfined pid=11031 comm="syz-executor2"  
exe="/root/syz-executor2" sig=9 arch=40000003 syscall=265 compat=1  
ip=0xf7fecca9 code=0x0
------------[ cut here ]------------
kernel BUG at arch/x86/kvm/x86.c:353!
------------[ cut here ]------------
kernel BUG at arch/x86/kvm/x86.c:353!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 11079 Comm: syz-executor2 Not tainted 4.19.0-rc7+ #178
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
RSP: 0018:ffff8801dae07bd8 EFLAGS: 00010006
RAX: ffff8801cc2f2180 RBX: 1ffff1003b5c0f7f RCX: ffffffff81385bcc
RDX: 0000000000010000 RSI: ffffffff810bd1f9 RDI: ffff8801dae07c18
RBP: ffff8801dae07bd8 R08: ffff8801cc2f2180 R09: ffffed003b5c5ba0
R10: ffffed003b5c5ba0 R11: ffff8801dae2dd07 R12: ffff8801dae07c58
R13: dffffc0000000000 R14: ffff8801beccc000 R15: ffff8801dae07c18
FS:  0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:00000000f5fa6b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: ffff8801dae07c18 CR3: 00000001cc8d1000 CR4: 00000000001426f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  <IRQ>
  kvm_fastop_exception+0x50b/0x5455
  loaded_vmcs_init arch/x86/kvm/vmx.c:2129 [inline]
  __loaded_vmcs_clear+0x2d6/0x690 arch/x86/kvm/vmx.c:2212
  flush_smp_call_function_queue+0x1d2/0x640 kernel/smp.c:243
  generic_smp_call_function_single_interrupt+0x13/0x2b kernel/smp.c:192
  smp_call_function_single_interrupt+0x12f/0x650 arch/x86/kernel/smp.c:296
  call_function_single_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:886
  </IRQ>
RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:798 [inline]
RIP: 0010:preempt_schedule_irq+0x7d/0x110 kernel/sched/core.c:3699
Code: 00 e8 87 6a a6 f9 e8 c2 d8 d5 f9 4c 89 f0 48 c1 e8 03 42 80 3c 20 00  
75 7b 48 83 3d 14 ea 82 01 00 74 61 fb 66 0f 1f 44 00 00 <bf> 01 00 00 00  
e8 f9 d1 ff ff 41 80 7d 00 00 75 6a 48 83 3d ea e9
RSP: 0018:ffff88018b397160 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff04
RAX: 1ffffffff1263e53 RBX: 0000000000000000 RCX: ffffc9000628e000
RDX: 0000000000000004 RSI: ffffffff8184e1e4 RDI: ffffffff896fe100
RBP: ffff88018b397188 R08: ffff8801cc2f2180 R09: ffffed003b5c5979
R10: ffffed003b5c5979 R11: ffff8801dae2cbcb R12: dffffc0000000000
R13: fffffbfff1263e52 R14: ffffffff8931f298 R15: ffffffff8931f290
  retint_kernel+0x1b/0x2d
RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:798 [inline]
RIP: 0010:cond_local_irq_enable arch/x86/kernel/traps.c:80 [inline]
RIP: 0010:do_error_trap+0x270/0x4d0 arch/x86/kernel/traps.c:301
Code: 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 4f 02 00 00 48 83  
3d 55 6a 07 08 00 0f 84 46 01 00 00 fb 66 0f 1f 44 00 00 <e9> b8 fe ff ff  
31 c0 41 b8 01 00 00 00 48 ba 00 00 00 00 00 fc ff
RSP: 0018:ffff88018b397248 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff02
RAX: dffffc0000000000 RBX: ffff88018b397398 RCX: ffffc9000628e000
RDX: 1ffffffff1263e53 RSI: ffffffff8184e1e4 RDI: ffffffff8931f298
RBP: ffff88018b397378 R08: ffff8801cc2f2180 R09: 0000000000000001
R10: fffffbfff12720fc R11: 0000000000000000 R12: 0000000000000006
R13: ffff88018b397350 R14: 0000000000000004 R15: 1ffff10031672e4e
  do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
  invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:993
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
RSP: 0018:ffff88018b397448 EFLAGS: 00010212
RAX: 0000000000040000 RBX: 1ffff10031672e8d RCX: ffffc9000628e000
RDX: 0000000000000417 RSI: ffffffff810bd1f9 RDI: ffff88018b397488
RBP: ffff88018b397448 R08: ffff8801cc2f2180 R09: ffff8801c308d000
R10: ffffed0038611bff R11: ffff8801c308dfff R12: ffff88018b3974c8
R13: dffffc0000000000 R14: ffff8801c308d000 R15: ffff88018b397488
  kvm_fastop_exception+0x50b/0x5455
  loaded_vmcs_init arch/x86/kvm/vmx.c:2129 [inline]
  alloc_loaded_vmcs+0x7f/0x280 arch/x86/kvm/vmx.c:4766
  vmx_create_vcpu+0x20e/0x25e0 arch/x86/kvm/vmx.c:11025
  kvm_arch_vcpu_create+0xe5/0x220 arch/x86/kvm/x86.c:8471
  kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:2476  
[inline]
  kvm_vm_ioctl+0x470/0x1d40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2977
  kvm_vm_compat_ioctl+0x143/0x430  
arch/x86/kvm/../../../virt/kvm/kvm_main.c:3170
  __do_compat_sys_ioctl fs/compat_ioctl.c:1419 [inline]
  __se_compat_sys_ioctl fs/compat_ioctl.c:1365 [inline]
  __ia32_compat_sys_ioctl+0x20e/0x630 fs/compat_ioctl.c:1365
  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:0xf7fecca9
Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 0c 24 c3 8b 1c 24 c3 90 90  
90 90 90 90 90 90 90 90 90 90 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:00000000f5fa60cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 000000000000000c RCX: 000000000000ae41
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 1c8fec48833612c0 ]---
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
RSP: 0018:ffff8801dae07bd8 EFLAGS: 00010006
RAX: ffff8801cc2f2180 RBX: 1ffff1003b5c0f7f RCX: ffffffff81385bcc
RDX: 0000000000010000 RSI: ffffffff810bd1f9 RDI: ffff8801dae07c18
RBP: ffff8801dae07bd8 R08: ffff8801cc2f2180 R09: ffffed003b5c5ba0
R10: ffffed003b5c5ba0 R11: ffff8801dae2dd07 R12: ffff8801dae07c58
R13: dffffc0000000000 R14: ffff8801beccc000 R15: ffff8801dae07c18
FS:  0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:00000000f5fa6b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: ffff8801dae07c18 CR3: 00000001cc8d1000 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 syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with  
syzbot.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kernel BUG at arch/x86/kvm/x86.c:LINE! (2)
  2018-10-10  7:52 kernel BUG at arch/x86/kvm/x86.c:LINE! (2) syzbot
@ 2018-10-10 12:33 ` syzbot
  2018-10-10 20:34 ` syzbot
  2018-10-11  2:57 ` Du Changbin
  2 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2018-10-10 12:33 UTC (permalink / raw)
  To: bp, hpa, kvm, linux-kernel, mingo, pbonzini, rkrcmar,
	syzkaller-bugs, tglx, x86

syzbot has found a reproducer for the following crash on:

HEAD commit:    3d647e62686f Merge tag 's390-4.19-4' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15fc834e400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=88e9a8a39dc0be2d
dashboard link: https://syzkaller.appspot.com/bug?extid=f9b42efadea9f5453100
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
userspace arch: i386
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1271be91400000

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

IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
8021q: adding VLAN 0 to HW filter on device team0
8021q: adding VLAN 0 to HW filter on device team0
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.
------------[ cut here ]------------
kernel BUG at arch/x86/kvm/x86.c:353!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 7328 Comm: syz-executor4 Not tainted 4.19.0-rc7+ #179
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
kobject: 'loop3' (0000000004d24d87): kobject_uevent_env
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
kobject: 'loop3' (0000000004d24d87): fill_kobj_path: path  
= '/devices/virtual/block/loop3'
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
RSP: 0018:ffff8801ce167340 EFLAGS: 00010093
RAX: ffff8801cd750440 RBX: 1ffff10039c2ce6c RCX: ffffffff81385bcc
RDX: 0000000000000000 RSI: ffffffff810bd1f9 RDI: ffff8801ce167380
kobject: 'kvm' (0000000063fb9207): kobject_uevent_env
RBP: ffff8801ce167340 R08: ffff8801cd750440 R09: fffff520003f4047
R10: fffff520003f4047 R11: ffffc90001fa023b R12: ffff8801ce1673c0
R13: dffffc0000000000 R14: ffff8801d7dc9000 R15: ffff8801ce167380
FS:  0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:0000000009b8d900
kobject: 'kvm' (0000000063fb9207): fill_kobj_path: path  
= '/devices/virtual/misc/kvm'
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: ffff8801ce167380 CR3: 00000001d5af7000 CR4: 00000000001426f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
kobject: 'kvm' (0000000063fb9207): kobject_uevent_env
  kvm_fastop_exception+0x50b/0x5455
------------[ cut here ]------------
kernel BUG at arch/x86/kvm/x86.c:353!
  loaded_vmcs_init arch/x86/kvm/vmx.c:2129 [inline]
  __loaded_vmcs_clear+0x2d6/0x690 arch/x86/kvm/vmx.c:2212
kobject: 'kvm' (0000000063fb9207): fill_kobj_path: path  
= '/devices/virtual/misc/kvm'
  generic_exec_single+0x373/0x5f0 kernel/smp.c:153
  smp_call_function_single+0x1b2/0x660 kernel/smp.c:299
  loaded_vmcs_clear arch/x86/kvm/vmx.c:2221 [inline]
  free_loaded_vmcs+0x13c/0x1b0 arch/x86/kvm/vmx.c:4746
  vmx_free_vcpu+0x204/0x300 arch/x86/kvm/vmx.c:10982
  kvm_arch_vcpu_free arch/x86/kvm/x86.c:8457 [inline]
  kvm_free_vcpus arch/x86/kvm/x86.c:8909 [inline]
  kvm_arch_destroy_vm+0x365/0x7c0 arch/x86/kvm/x86.c:9006
  kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:752 [inline]
  kvm_put_kvm+0x6c8/0xff0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:773
  kvm_vcpu_release+0x7b/0xa0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2407
  __fput+0x385/0xa30 fs/file_table.c:278
  ____fput+0x15/0x20 fs/file_table.c:309
  task_work_run+0x1e8/0x2a0 kernel/task_work.c:113
  tracehook_notify_resume include/linux/tracehook.h:193 [inline]
  exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166
  prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
  syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
  do_syscall_32_irqs_on arch/x86/entry/common.c:341 [inline]
  do_fast_syscall_32+0xcd5/0xfb2 arch/x86/entry/common.c:397
  entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7efdca9
Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 0c 24 c3 8b 1c 24 c3 90 90  
90 90 90 90 90 90 90 90 90 90 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:000000000845fdac EFLAGS: 00000216 ORIG_RAX: 0000000000000006
RAX: 0000000000000000 RBX: 0000000000000007 RCX: 0000000000000000
RDX: 0000000000000008 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 2ea88a0e29b1263b ]---
invalid opcode: 0000 [#2] PREEMPT SMP KASAN
CPU: 1 PID: 7351 Comm: syz-executor3 Tainted: G      D            
4.19.0-rc7+ #179
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
RSP: 0018:ffff8801ce167340 EFLAGS: 00010093
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
RSP: 0018:ffff8801cd357448 EFLAGS: 00010293
RAX: ffff8801cd750440 RBX: 1ffff10039c2ce6c RCX: ffffffff81385bcc
RDX: 0000000000000000 RSI: ffffffff810bd1f9 RDI: ffff8801ce167380
RAX: ffff8801bbcea080 RBX: 1ffff10039a6ae8d RCX: ffffffff81385bcc
RBP: ffff8801ce167340 R08: ffff8801cd750440 R09: fffff520003f4047
RDX: 0000000000000000 RSI: ffffffff810bd1f9 RDI: ffff8801cd357488
R10: fffff520003f4047 R11: ffffc90001fa023b R12: ffff8801ce1673c0
RBP: ffff8801cd357448 R08: ffff8801bbcea080 R09: ffff8801ce981000
R13: dffffc0000000000 R14: ffff8801d7dc9000 R15: ffff8801ce167380
R10: ffffed0039d303ff R11: ffff8801ce981fff R12: ffff8801cd3574c8
FS:  0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:0000000009b8d900
R13: dffffc0000000000 R14: ffff8801ce981000 R15: ffff8801cd357488
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
FS:  0000000000000000(0000) GS:ffff8801daf00000(0063) knlGS:00000000f7ef6b40
CR2: ffff8801ce167380 CR3: 00000001d5af7000 CR4: 00000000001426f0
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
CR2: 00007f1f49c6b000 CR3: 00000001cf36e000 CR4: 00000000001426e0
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kernel BUG at arch/x86/kvm/x86.c:LINE! (2)
  2018-10-10  7:52 kernel BUG at arch/x86/kvm/x86.c:LINE! (2) syzbot
  2018-10-10 12:33 ` syzbot
@ 2018-10-10 20:34 ` syzbot
  2018-10-11  2:57 ` Du Changbin
  2 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2018-10-10 20:34 UTC (permalink / raw)
  To: bp, hpa, kvm, linux-kernel, mingo, pbonzini, rkrcmar,
	syzkaller-bugs, tglx, x86

syzbot has found a reproducer for the following crash on:

HEAD commit:    3d647e62686f Merge tag 's390-4.19-4' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11be99a1400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=88e9a8a39dc0be2d
dashboard link: https://syzkaller.appspot.com/bug?extid=f9b42efadea9f5453100
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1057d809400000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=131e37c9400000

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

audit: type=1400 audit(1539203398.925:36): avc:  denied  { map } for   
pid=5855 comm="syz-executor775" path="/root/syz-executor775778886"  
dev="sda1" ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023  
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
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.
------------[ cut here ]------------
kernel BUG at arch/x86/kvm/x86.c:353!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
kobject: 'kvm' (00000000154a8e53): fill_kobj_path: path  
= '/devices/virtual/misc/kvm'
CPU: 0 PID: 5871 Comm: syz-executor775 Not tainted 4.19.0-rc7+ #55
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
RSP: 0018:ffff8801c428f388 EFLAGS: 00010293
RAX: ffff8801c5676380 RBX: ffff8801c428f408 RCX: ffffffff81385bcc
RDX: 0000000000000000 RSI: ffffffff810bd1f9 RDI: ffff8801c428f3c8
RBP: ffff8801c428f388 R08: ffff8801c5676380 R09: fffff520003dea46
R10: fffff520003dea46 R11: ffffc90001ef5237 R12: 1ffff10038851e75
R13: ffff8801c428f3c8 R14: ffff8801c481d000 R15: ffff8801c7cdb000
FS:  00007f4825a83700(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff8801c428f3c8 CR3: 00000001c4e7c000 CR4: 00000000001426f0
kobject: 'kvm' (00000000154a8e53): kobject_uevent_env
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  kvm_fastop_exception+0x523/0x5455
kobject: 'kvm' (00000000154a8e53): kobject_uevent_env
kobject: 'kvm' (00000000154a8e53): fill_kobj_path: path  
= '/devices/virtual/misc/kvm'
  vmx_vcpu_load+0x496/0x1030 arch/x86/kvm/vmx.c:3079
------------[ cut here ]------------
kernel BUG at arch/x86/kvm/x86.c:353!
  kvm_arch_vcpu_load+0x247/0x970 arch/x86/kvm/x86.c:3109
  vcpu_load+0x35/0x70 arch/x86/kvm/../../../virt/kvm/kvm_main.c:164
  kvm_arch_vcpu_setup+0x1d/0x40 arch/x86/kvm/x86.c:8479
  kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:2484  
[inline]
  kvm_vm_ioctl+0x107d/0x1d40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2977
  vfs_ioctl fs/ioctl.c:46 [inline]
  file_ioctl fs/ioctl.c:501 [inline]
  do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685
  ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702
  __do_sys_ioctl fs/ioctl.c:709 [inline]
  __se_sys_ioctl fs/ioctl.c:707 [inline]
  __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707
  do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x446df9
Code: e8 dc e6 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 4b 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f4825a82da8 EFLAGS: 00000297 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000006dcc48 RCX: 0000000000446df9
RDX: 0000000000000000 RSI: 000000000000ae41 RDI: 0000000000000004
RBP: 00000000006dcc40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000297 R12: 00000000006dcc4c
R13: 6d766b2f7665642f R14: 00007f4825a839c0 R15: 00000000006dcd4c
Modules linked in:
invalid opcode: 0000 [#2] PREEMPT SMP KASAN
---[ end trace 646ff58a828dac28 ]---
CPU: 1 PID: 5870 Comm: syz-executor775 Tainted: G      D            
4.19.0-rc7+ #55
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
RSP: 0018:ffff8801c4347380 EFLAGS: 00010093
RAX: ffff8801c5662340 RBX: 1ffff10038868e74 RCX: ffffffff81385bcc
RDX: 0000000000000000 RSI: ffffffff810bd1f9 RDI: ffff8801c43473c0
RBP: ffff8801c4347380 R08: ffff8801c5662340 R09: fffff520003e0247
Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f  
5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44  
00 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
R10: fffff520003e0247 R11: ffffc90001f0123b R12: ffff8801c4347400
RSP: 0018:ffff8801c428f388 EFLAGS: 00010293
R13: dffffc0000000000 R14: ffff8801be3c2000 R15: ffff8801c43473c0
FS:  00000000010fc880(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff8801c43473c0 CR3: 00000001c44d8000 CR4: 00000000001426e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
RAX: ffff8801c5676380 RBX: ffff8801c428f408 RCX: ffffffff81385bcc
Call Trace:
RDX: 0000000000000000 RSI: ffffffff810bd1f9 RDI: ffff8801c428f3c8
  kvm_fastop_exception+0x50b/0x5455
RBP: ffff8801c428f388 R08: ffff8801c5676380 R09: fffff520003dea46
R10: fffff520003dea46 R11: ffffc90001ef5237 R12: 1ffff10038851e75
  loaded_vmcs_init arch/x86/kvm/vmx.c:2129 [inline]
  __loaded_vmcs_clear+0x2d6/0x690 arch/x86/kvm/vmx.c:2212
R13: ffff8801c428f3c8 R14: ffff8801c481d000 R15: ffff8801c7cdb000
FS:  00007f4825a83700(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  generic_exec_single+0x373/0x5f0 kernel/smp.c:153
CR2: ffff8801c428f3c8 CR3: 00000001c4e7c000 CR4: 00000000001426f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  smp_call_function_single+0x1b2/0x660 kernel/smp.c:299


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kernel BUG at arch/x86/kvm/x86.c:LINE! (2)
  2018-10-10  7:52 kernel BUG at arch/x86/kvm/x86.c:LINE! (2) syzbot
  2018-10-10 12:33 ` syzbot
  2018-10-10 20:34 ` syzbot
@ 2018-10-11  2:57 ` Du Changbin
  2018-10-11 14:32   ` Paolo Bonzini
  2 siblings, 1 reply; 6+ messages in thread
From: Du Changbin @ 2018-10-11  2:57 UTC (permalink / raw)
  To: syzbot
  Cc: bp, hpa, kvm, linux-kernel, mingo, pbonzini, rkrcmar,
	syzkaller-bugs, tglx, x86, changbin.du

I think the issue is that using vmx instructions after vmx off. The 
scenario is:
1. kernel is rebooting and vmx is turned off by notification handler 
kvm_reboot(),
    and 'kvm_rebooting' is set.
2. But there is a pending KVM_CREATE_VCPU ioctl which will invoke 
vmcs_clear()->
    ____kvm_handle_fault_on_reboot()->kvm_spurious_fault()->BUG().

Need to improve the handler for such case so won't hang kernel.

On Wed, Oct 10, 2018 at 12:52:03AM -0700, syzbot wrote:
> Hello,
> 
> syzbot found the following crash on:
> 
> HEAD commit:    64c5e530ac2c Merge tag 'arc-4.19-rc8' of git://git.kernel...
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=167a4e85400000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=88e9a8a39dc0be2d
> dashboard link: https://syzkaller.appspot.com/bug?extid=f9b42efadea9f5453100
> compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
> userspace arch: i386
> 
> 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+f9b42efadea9f5453100@syzkaller.appspotmail.com
> 
> Use struct sctp_sack_info instead
> sctp: [Deprecated]: syz-executor0 (pid 11077) Use of struct sctp_assoc_value
> in delayed_ack socket option.
> Use struct sctp_sack_info instead
> audit: type=1326 audit(1539141761.977:32): auid=4294967295 uid=0 gid=0
> ses=4294967295 subj==unconfined pid=11031 comm="syz-executor2"
> exe="/root/syz-executor2" sig=9 arch=40000003 syscall=265 compat=1
> ip=0xf7fecca9 code=0x0
> ------------[ cut here ]------------
> kernel BUG at arch/x86/kvm/x86.c:353!
> ------------[ cut here ]------------
> kernel BUG at arch/x86/kvm/x86.c:353!
> invalid opcode: 0000 [#1] PREEMPT SMP KASAN
> CPU: 0 PID: 11079 Comm: syz-executor2 Not tainted 4.19.0-rc7+ #178
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011
> RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
> Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f
> 5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44 00
> 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
> RSP: 0018:ffff8801dae07bd8 EFLAGS: 00010006
> RAX: ffff8801cc2f2180 RBX: 1ffff1003b5c0f7f RCX: ffffffff81385bcc
> RDX: 0000000000010000 RSI: ffffffff810bd1f9 RDI: ffff8801dae07c18
> RBP: ffff8801dae07bd8 R08: ffff8801cc2f2180 R09: ffffed003b5c5ba0
> R10: ffffed003b5c5ba0 R11: ffff8801dae2dd07 R12: ffff8801dae07c58
> R13: dffffc0000000000 R14: ffff8801beccc000 R15: ffff8801dae07c18
> FS:  0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:00000000f5fa6b40
> CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
> CR2: ffff8801dae07c18 CR3: 00000001cc8d1000 CR4: 00000000001426f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>  <IRQ>
>  kvm_fastop_exception+0x50b/0x5455
>  loaded_vmcs_init arch/x86/kvm/vmx.c:2129 [inline]
>  __loaded_vmcs_clear+0x2d6/0x690 arch/x86/kvm/vmx.c:2212
>  flush_smp_call_function_queue+0x1d2/0x640 kernel/smp.c:243
>  generic_smp_call_function_single_interrupt+0x13/0x2b kernel/smp.c:192
>  smp_call_function_single_interrupt+0x12f/0x650 arch/x86/kernel/smp.c:296
>  call_function_single_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:886
>  </IRQ>
> RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:798 [inline]
> RIP: 0010:preempt_schedule_irq+0x7d/0x110 kernel/sched/core.c:3699
> Code: 00 e8 87 6a a6 f9 e8 c2 d8 d5 f9 4c 89 f0 48 c1 e8 03 42 80 3c 20 00
> 75 7b 48 83 3d 14 ea 82 01 00 74 61 fb 66 0f 1f 44 00 00 <bf> 01 00 00 00 e8
> f9 d1 ff ff 41 80 7d 00 00 75 6a 48 83 3d ea e9
> RSP: 0018:ffff88018b397160 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff04
> RAX: 1ffffffff1263e53 RBX: 0000000000000000 RCX: ffffc9000628e000
> RDX: 0000000000000004 RSI: ffffffff8184e1e4 RDI: ffffffff896fe100
> RBP: ffff88018b397188 R08: ffff8801cc2f2180 R09: ffffed003b5c5979
> R10: ffffed003b5c5979 R11: ffff8801dae2cbcb R12: dffffc0000000000
> R13: fffffbfff1263e52 R14: ffffffff8931f298 R15: ffffffff8931f290
>  retint_kernel+0x1b/0x2d
> RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:798 [inline]
> RIP: 0010:cond_local_irq_enable arch/x86/kernel/traps.c:80 [inline]
> RIP: 0010:do_error_trap+0x270/0x4d0 arch/x86/kernel/traps.c:301
> Code: 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 4f 02 00 00 48 83
> 3d 55 6a 07 08 00 0f 84 46 01 00 00 fb 66 0f 1f 44 00 00 <e9> b8 fe ff ff 31
> c0 41 b8 01 00 00 00 48 ba 00 00 00 00 00 fc ff
> RSP: 0018:ffff88018b397248 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff02
> RAX: dffffc0000000000 RBX: ffff88018b397398 RCX: ffffc9000628e000
> RDX: 1ffffffff1263e53 RSI: ffffffff8184e1e4 RDI: ffffffff8931f298
> RBP: ffff88018b397378 R08: ffff8801cc2f2180 R09: 0000000000000001
> R10: fffffbfff12720fc R11: 0000000000000000 R12: 0000000000000006
> R13: ffff88018b397350 R14: 0000000000000004 R15: 1ffff10031672e4e
>  do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
>  invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:993
> RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
> Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f
> 5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44 00
> 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
> RSP: 0018:ffff88018b397448 EFLAGS: 00010212
> RAX: 0000000000040000 RBX: 1ffff10031672e8d RCX: ffffc9000628e000
> RDX: 0000000000000417 RSI: ffffffff810bd1f9 RDI: ffff88018b397488
> RBP: ffff88018b397448 R08: ffff8801cc2f2180 R09: ffff8801c308d000
> R10: ffffed0038611bff R11: ffff8801c308dfff R12: ffff88018b3974c8
> R13: dffffc0000000000 R14: ffff8801c308d000 R15: ffff88018b397488
>  kvm_fastop_exception+0x50b/0x5455
>  loaded_vmcs_init arch/x86/kvm/vmx.c:2129 [inline]
>  alloc_loaded_vmcs+0x7f/0x280 arch/x86/kvm/vmx.c:4766
>  vmx_create_vcpu+0x20e/0x25e0 arch/x86/kvm/vmx.c:11025
>  kvm_arch_vcpu_create+0xe5/0x220 arch/x86/kvm/x86.c:8471
>  kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:2476
> [inline]
>  kvm_vm_ioctl+0x470/0x1d40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2977
>  kvm_vm_compat_ioctl+0x143/0x430
> arch/x86/kvm/../../../virt/kvm/kvm_main.c:3170
>  __do_compat_sys_ioctl fs/compat_ioctl.c:1419 [inline]
>  __se_compat_sys_ioctl fs/compat_ioctl.c:1365 [inline]
>  __ia32_compat_sys_ioctl+0x20e/0x630 fs/compat_ioctl.c:1365
>  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:0xf7fecca9
> Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 0c 24 c3 8b 1c 24 c3 90 90
> 90 90 90 90 90 90 90 90 90 90 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:00000000f5fa60cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036
> RAX: ffffffffffffffda RBX: 000000000000000c RCX: 000000000000ae41
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
> R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
> Modules linked in:
> ---[ end trace 1c8fec48833612c0 ]---
> RIP: 0010:kvm_spurious_fault+0x9/0x10 arch/x86/kvm/x86.c:353
> Code: 45 10 50 e8 e9 44 7c 00 58 5a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f
> 5d c3 0f 1f 84 00 00 00 00 00 55 48 89 e5 e8 97 03 73 00 <0f> 0b 0f 1f 44 00
> 00 55 48 89 e5 41 57 41 56 41 55 41 89 fd 41 54
> RSP: 0018:ffff8801dae07bd8 EFLAGS: 00010006
> RAX: ffff8801cc2f2180 RBX: 1ffff1003b5c0f7f RCX: ffffffff81385bcc
> RDX: 0000000000010000 RSI: ffffffff810bd1f9 RDI: ffff8801dae07c18
> RBP: ffff8801dae07bd8 R08: ffff8801cc2f2180 R09: ffffed003b5c5ba0
> R10: ffffed003b5c5ba0 R11: ffff8801dae2dd07 R12: ffff8801dae07c58
> R13: dffffc0000000000 R14: ffff8801beccc000 R15: ffff8801dae07c18
> FS:  0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:00000000f5fa6b40
> CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
> CR2: ffff8801dae07c18 CR3: 00000001cc8d1000 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 syzkaller@googlegroups.com.
> 
> syzbot will keep track of this bug report. See:
> https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
> syzbot.

-- 
Thanks,
Du Changbin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kernel BUG at arch/x86/kvm/x86.c:LINE! (2)
  2018-10-11  2:57 ` Du Changbin
@ 2018-10-11 14:32   ` Paolo Bonzini
  2018-10-11 18:05     ` Dmitry Vyukov
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2018-10-11 14:32 UTC (permalink / raw)
  To: Du Changbin, syzbot
  Cc: bp, hpa, kvm, linux-kernel, mingo, rkrcmar, syzkaller-bugs, tglx,
	x86, changbin.du, Dmitry Vyukov

On 11/10/2018 04:57, Du Changbin wrote:
> I think the issue is that using vmx instructions after vmx off. The
> scenario is:
> 1. kernel is rebooting and vmx is turned off by notification handler
> kvm_reboot(),
>    and 'kvm_rebooting' is set.
> 2. But there is a pending KVM_CREATE_VCPU ioctl which will invoke
> vmcs_clear()->
>    ____kvm_handle_fault_on_reboot()->kvm_spurious_fault()->BUG().
> 
> Need to improve the handler for such case so won't hang kernel.

Why would the kernel be rebooting, given the reproducer (listed below my
signature, or at https://syzkaller.appspot.com/x/repro.c?x=131e37c9400000)?

I think this is a duplicate of

   WARNING: refcount bug in kvm_vm_ioctl
   BUG: unable to handle kernel paging request in
refcount_inc_not_zero_checked

In all cases the refcounts seem to be broken, and kvm_destroy_kvm is
called prematurely (which in this case results in hardware_disable_all
being called, so that the vmclear fails).

Dmitry, have such bugs been reported for subsystems other than KVM?

Paolo

#syz dup: WARNING: refcount bug in kvm_vm_ioctl

> # See https://goo.gl/kgGztJ for information about syzkaller reproducers.
> #{"threaded":true,"repeat":true,"procs":6,"sandbox":"","fault_call":-1,"tmpdir":true}
> r0 = openat$kvm(0xffffffffffffff9c, &(0x7f0000000080)='/dev/kvm\x00', 0x0, 0x0)
> r1 = ioctl$KVM_CREATE_VM(r0, 0xae01, 0x0)
> r2 = ioctl$KVM_CREATE_VCPU(r1, 0xae41, 0x0)
> ioctl$KVM_SET_VCPU_EVENTS(r2, 0x4040aea0, &(0x7f0000000000)={0x5, 0x7, 0x40, 0x0, 0x0, 0x0, 0x0, 0x492, 0x5, 0x1, 0xffff, 0x0, 0x0, 0xef, 0x100000000, 0x0, 0x100})
> ioctl$KVM_SET_USER_MEMORY_REGION(r1, 0x4020ae46, &(0x7f0000000040)={0x0, 0x0, 0x0, 0x2000, &(0x7f0000ffe000/0x2000)=nil})
> ioctl$KVM_SET_SREGS(r2, 0x4138ae84, &(0x7f00000003c0)={{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, 0x8005001f, 0x0, 0x0, 0x28, 0x0, 0x6500})
> ioctl$KVM_RUN(r2, 0xae80, 0x0)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: kernel BUG at arch/x86/kvm/x86.c:LINE! (2)
  2018-10-11 14:32   ` Paolo Bonzini
@ 2018-10-11 18:05     ` Dmitry Vyukov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Vyukov @ 2018-10-11 18:05 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Du Changbin, syzbot, Borislav Petkov, H. Peter Anvin, KVM list,
	LKML, Ingo Molnar, Radim Krčmář,
	syzkaller-bugs, Thomas Gleixner, the arch/x86 maintainers,
	changbin.du

On Thu, Oct 11, 2018 at 4:32 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 11/10/2018 04:57, Du Changbin wrote:
>> I think the issue is that using vmx instructions after vmx off. The
>> scenario is:
>> 1. kernel is rebooting and vmx is turned off by notification handler
>> kvm_reboot(),
>>    and 'kvm_rebooting' is set.
>> 2. But there is a pending KVM_CREATE_VCPU ioctl which will invoke
>> vmcs_clear()->
>>    ____kvm_handle_fault_on_reboot()->kvm_spurious_fault()->BUG().
>>
>> Need to improve the handler for such case so won't hang kernel.
>
> Why would the kernel be rebooting, given the reproducer (listed below my
> signature, or at https://syzkaller.appspot.com/x/repro.c?x=131e37c9400000)?
>
> I think this is a duplicate of
>
>    WARNING: refcount bug in kvm_vm_ioctl
>    BUG: unable to handle kernel paging request in
> refcount_inc_not_zero_checked
>
> In all cases the refcounts seem to be broken, and kvm_destroy_kvm is
> called prematurely (which in this case results in hardware_disable_all
> being called, so that the vmclear fails).
>
> Dmitry, have such bugs been reported for subsystems other than KVM?

We have _all_ types of bugs reported in _all_ subsystems. So you need
to be more precise :)

You can see all currently open bugs here:
https://syzkaller.appspot.com/#upstream

And here you can search over reports:
https://groups.google.com/forum/#!forum/syzkaller-bugs

E.g.:
https://groups.google.com/forum/#!searchin/syzkaller-bugs/refcount_inc_not_zero_checked

We had this recently, which is task_struct refcount bug:
https://syzkaller.appspot.com/bug?id=e1854417677586ce3d00f498f19816cb4fd15676
but this seems to be related to rdma. And repro for this bug only
deals with kvm. So my guess would be that this is a different bug in
kvm.
If you can reproduce it, then perhaps logging all refcount operation
on the thing will help to find whoever releases a ref it does not own.


> Paolo
>
> #syz dup: WARNING: refcount bug in kvm_vm_ioctl
>
>> # See https://goo.gl/kgGztJ for information about syzkaller reproducers.
>> #{"threaded":true,"repeat":true,"procs":6,"sandbox":"","fault_call":-1,"tmpdir":true}
>> r0 = openat$kvm(0xffffffffffffff9c, &(0x7f0000000080)='/dev/kvm\x00', 0x0, 0x0)
>> r1 = ioctl$KVM_CREATE_VM(r0, 0xae01, 0x0)
>> r2 = ioctl$KVM_CREATE_VCPU(r1, 0xae41, 0x0)
>> ioctl$KVM_SET_VCPU_EVENTS(r2, 0x4040aea0, &(0x7f0000000000)={0x5, 0x7, 0x40, 0x0, 0x0, 0x0, 0x0, 0x492, 0x5, 0x1, 0xffff, 0x0, 0x0, 0xef, 0x100000000, 0x0, 0x100})
>> ioctl$KVM_SET_USER_MEMORY_REGION(r1, 0x4020ae46, &(0x7f0000000040)={0x0, 0x0, 0x0, 0x2000, &(0x7f0000ffe000/0x2000)=nil})
>> ioctl$KVM_SET_SREGS(r2, 0x4138ae84, &(0x7f00000003c0)={{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, 0x8005001f, 0x0, 0x0, 0x28, 0x0, 0x6500})
>> ioctl$KVM_RUN(r2, 0xae80, 0x0)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-11 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-10  7:52 kernel BUG at arch/x86/kvm/x86.c:LINE! (2) syzbot
2018-10-10 12:33 ` syzbot
2018-10-10 20:34 ` syzbot
2018-10-11  2:57 ` Du Changbin
2018-10-11 14:32   ` Paolo Bonzini
2018-10-11 18:05     ` Dmitry Vyukov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).