All of lore.kernel.org
 help / color / mirror / Atom feed
* [syzbot] KMSAN: uninit-value in kvm_irq_delivery_to_apic_fast
@ 2022-06-28 11:37 syzbot
  2022-06-28 13:01 ` Vitaly Kuznetsov
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2022-06-28 11:37 UTC (permalink / raw)
  To: bp, dave.hansen, glider, hpa, jmattson, joro, kvm, linux-kernel,
	mingo, pbonzini, seanjc, syzkaller-bugs, tglx, vkuznets,
	wanpengli, x86

Hello,

syzbot found the following issue on:

HEAD commit:    4b28366af7d9 x86: kmsan: enable KMSAN builds for x86
git tree:       https://github.com/google/kmsan.git master
console+strace: https://syzkaller.appspot.com/x/log.txt?x=126a4b60080000
kernel config:  https://syzkaller.appspot.com/x/.config?x=d14e10a167d1c585
dashboard link: https://syzkaller.appspot.com/bug?extid=d6caa905917d353f0d07
compiler:       clang version 15.0.0 (https://github.com/llvm/llvm-project.git 610139d2d9ce6746b3c617fb3e2f7886272d26ff), GNU ld (GNU Binutils for Debian) 2.35.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14d596c4080000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=10bcf08ff00000

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

L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details.
=====================================================
BUG: KMSAN: uninit-value in kvm_apic_set_irq arch/x86/kvm/lapic.c:634 [inline]
BUG: KMSAN: uninit-value in kvm_irq_delivery_to_apic_fast+0x7a7/0x990 arch/x86/kvm/lapic.c:1044
 kvm_apic_set_irq arch/x86/kvm/lapic.c:634 [inline]
 kvm_irq_delivery_to_apic_fast+0x7a7/0x990 arch/x86/kvm/lapic.c:1044
 kvm_irq_delivery_to_apic+0xdb/0xe40 arch/x86/kvm/irq_comm.c:54
 kvm_pv_kick_cpu_op+0xd1/0x100 arch/x86/kvm/x86.c:9155
 kvm_emulate_hypercall+0xee7/0x1340 arch/x86/kvm/x86.c:9285
 __vmx_handle_exit+0x101f/0x1710 arch/x86/kvm/vmx/vmx.c:6237
 vmx_handle_exit+0x38/0x1f0 arch/x86/kvm/vmx/vmx.c:6254
 vcpu_enter_guest+0x4733/0x52d0 arch/x86/kvm/x86.c:10366
 vcpu_run+0x794/0x1230 arch/x86/kvm/x86.c:10455
 kvm_arch_vcpu_ioctl_run+0x11fe/0x1b30 arch/x86/kvm/x86.c:10659
 kvm_vcpu_ioctl+0xcd4/0x1980 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3948
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0x222/0x400 fs/ioctl.c:856
 __x64_sys_ioctl+0x92/0xd0 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0

Local variable lapic_irq created at:
 kvm_pv_kick_cpu_op+0x46/0x100 arch/x86/kvm/x86.c:9146
 kvm_emulate_hypercall+0xee7/0x1340 arch/x86/kvm/x86.c:9285

CPU: 1 PID: 3490 Comm: syz-executor407 Not tainted 5.19.0-rc3-syzkaller-30868-g4b28366af7d9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
=====================================================


---
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 syzkaller@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

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

* Re: [syzbot] KMSAN: uninit-value in kvm_irq_delivery_to_apic_fast
  2022-06-28 11:37 [syzbot] KMSAN: uninit-value in kvm_irq_delivery_to_apic_fast syzbot
@ 2022-06-28 13:01 ` Vitaly Kuznetsov
  0 siblings, 0 replies; 2+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-28 13:01 UTC (permalink / raw)
  To: kvm
  Cc: syzbot, bp, dave.hansen, glider, hpa, jmattson, joro,
	linux-kernel, mingo, pbonzini, seanjc, syzkaller-bugs, tglx,
	wanpengli, x86

syzbot <syzbot+d6caa905917d353f0d07@syzkaller.appspotmail.com> writes:

> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:    4b28366af7d9 x86: kmsan: enable KMSAN builds for x86
> git tree:       https://github.com/google/kmsan.git master
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=126a4b60080000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=d14e10a167d1c585
> dashboard link: https://syzkaller.appspot.com/bug?extid=d6caa905917d353f0d07
> compiler:       clang version 15.0.0 (https://github.com/llvm/llvm-project.git 610139d2d9ce6746b3c617fb3e2f7886272d26ff), GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14d596c4080000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=10bcf08ff00000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+d6caa905917d353f0d07@syzkaller.appspotmail.com
>
> L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details.
> =====================================================
> BUG: KMSAN: uninit-value in kvm_apic_set_irq arch/x86/kvm/lapic.c:634 [inline]
> BUG: KMSAN: uninit-value in kvm_irq_delivery_to_apic_fast+0x7a7/0x990 arch/x86/kvm/lapic.c:1044
>  kvm_apic_set_irq arch/x86/kvm/lapic.c:634 [inline]
>  kvm_irq_delivery_to_apic_fast+0x7a7/0x990 arch/x86/kvm/lapic.c:1044
>  kvm_irq_delivery_to_apic+0xdb/0xe40 arch/x86/kvm/irq_comm.c:54
>  kvm_pv_kick_cpu_op+0xd1/0x100 arch/x86/kvm/x86.c:9155
>  kvm_emulate_hypercall+0xee7/0x1340 arch/x86/kvm/x86.c:9285

...

According to the syz repro (and AFAIU), kvm_pv_kick_cpu_op()
doesn't set 'irq->vector' which is not really needed for APIC_DM_REMRD
but we still reference it e.g. in trace_kvm_apic_accept_irq().

I'll can send a patch (if noone beats me to it).

Thanks for the report!

-- 
Vitaly


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

end of thread, other threads:[~2022-06-28 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 11:37 [syzbot] KMSAN: uninit-value in kvm_irq_delivery_to_apic_fast syzbot
2022-06-28 13:01 ` Vitaly Kuznetsov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.