syzbot


WARNING: refcount bug in kvm_vm_ioctl

Status: fixed on 2019/03/06 07:43
Subsystems: kvm
[Documentation on labels]
Reported-by: syzbot+6df4d24a0a50fd5d1a08@syzkaller.appspotmail.com
Fix commit: cfa39381173d kvm: fix kvm_ioctl_create_device() reference counting (CVE-2019-6974)
First crash: 2034d, last: 1911d
Duplicate bugs (2)
duplicates (2):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
BUG: unable to handle kernel paging request in refcount_inc_not_zero_checked kvm 2 1968d 2024d 0/26 closed as dup on 2018/10/11 14:33
kernel BUG at arch/x86/kvm/x86.c:LINE! (2) kvm C 193 1878d 2024d 0/26 closed as dup on 2018/10/11 14:32
Discussions (1)
Title Replies (including bot) Last reply
WARNING: refcount bug in kvm_vm_ioctl 10 (11) 2019/02/16 06:28

Sample crash report:
------------[ cut here ]------------
refcount_t: increment on 0; use-after-free.
WARNING: CPU: 0 PID: 29295 at lib/refcount.c:153 refcount_inc_checked lib/refcount.c:153 [inline]
WARNING: CPU: 0 PID: 29295 at lib/refcount.c:153 refcount_inc_checked+0x61/0x70 lib/refcount.c:151
Kernel panic - not syncing: panic_on_warn set ...
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
CPU: 0 PID: 29295 Comm: syz-executor2 Not tainted 5.0.0-rc2+ #30
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+0x1db/0x2d0 lib/dump_stack.c:113
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
 panic+0x2cb/0x65c kernel/panic.c:214
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
 __warn.cold+0x20/0x48 kernel/panic.c:571
 report_bug+0x263/0x2b0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:178 [inline]
 fixup_bug arch/x86/kernel/traps.c:173 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:290
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:973
RIP: 0010:refcount_inc_checked lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc_checked+0x61/0x70 lib/refcount.c:151
Code: 1d 6c 4d c8 06 31 ff 89 de e8 db 3e f2 fd 84 db 75 dd e8 92 3d f2 fd 48 c7 c7 a0 95 81 88 c6 05 4c 4d c8 06 01 e8 3f 8c bb fd <0f> 0b eb c1 90 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 54 49
RSP: 0018:ffff888088d4f7f8 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
RDX: 0000000000000000 RSI: ffffffff81685456 RDI: 0000000000000005
RBP: ffff888088d4f808 R08: ffff8880959e8100 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffc90008ba46b8
R13: ffff8880a89e4400 R14: ffffffff898bdf60 R15: ffffc90008b9b000
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
 kvm_get_kvm arch/x86/kvm/../../../virt/kvm/kvm_main.c:762 [inline]
 kvm_ioctl_create_device arch/x86/kvm/../../../virt/kvm/kvm_main.c:3012 [inline]
 kvm_vm_ioctl+0x117f/0x1fe0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3250
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
kobject: 'loop1' (000000005264e0d1): kobject_uevent_env
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
kobject: 'loop1' (000000005264e0d1): fill_kobj_path: path = '/devices/virtual/block/loop1'
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:509 [inline]
 do_vfs_ioctl+0x107b/0x17d0 fs/ioctl.c:696
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl fs/ioctl.c:718 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x458099
kobject: 'kvm' (000000003e95c776): kobject_uevent_env
Code: 6d b7 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
kobject: 'kvm' (000000003e95c776): fill_kobj_path: path = '/devices/virtual/misc/kvm'
RSP: 002b:00007fe475edbc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458099
RDX: 0000000020000340 RSI: 00000000c00caee0 RDI: 0000000000000007
RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe475edc6d4
kobject: 'loop3' (0000000031f0f554): kobject_uevent_env
R13: 00000000004c0b92 R14: 00000000004d2770 R15: 00000000ffffffff
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/01/18 01:17 upstream 7fbfee7c80de 769e75ed .config console log report syz ci-upstream-kasan-gce-selinux-root
2019/01/17 21:44 upstream 7fbfee7c80de 769e75ed .config console log report syz ci-upstream-kasan-gce-smack-root
2018/10/10 03:04 upstream 64c5e530ac2c 8b311eaf .config console log report syz ci-upstream-kasan-gce-root
2018/10/10 01:30 upstream 64c5e530ac2c 8b311eaf .config console log report syz ci-upstream-kasan-gce-selinux-root
2018/12/05 10:23 upstream 0072a0c14d5b f162ad97 .config console log report syz ci-upstream-kasan-gce-386
2018/11/11 21:44 upstream e255aee5b66c 7b5f8621 .config console log report syz ci-upstream-kasan-gce-386
2019/01/17 22:59 linux-next a37d50ca3b83 769e75ed .config console log report syz ci-upstream-linux-next-kasan-gce-root
2018/10/10 01:02 linux-next 570b7bdeaf18 8b311eaf .config console log report syz ci-upstream-linux-next-kasan-gce-root
2019/01/17 20:09 upstream 7fbfee7c80de 769e75ed .config console log report ci-upstream-kasan-gce-smack-root
2018/12/21 17:25 upstream 9097a058d49e 588075e6 .config console log report ci-upstream-kasan-gce-selinux-root
2018/11/23 15:43 upstream edeca3a769ad 2b0dc848 .config console log report ci-upstream-kasan-gce-smack-root
2019/01/31 05:38 upstream 1c0490ce9022 aa432daf .config console log report ci-upstream-kasan-gce-386
2018/09/30 08:58 upstream 291d0e5d81e1 41e4b329 .config console log report ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.