lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aSY3RJI6uvrbh92_@google.com>
Date: Tue, 25 Nov 2025 15:09:56 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: syzbot <syzbot+59f2c3a3fc4f6c09b8cd@...kaller.appspotmail.com>
Cc: bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com, 
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org, mingo@...hat.com, 
	pbonzini@...hat.com, syzkaller-bugs@...glegroups.com, tglx@...utronix.de, 
	x86@...nel.org
Subject: Re: [syzbot] [kvm-x86?] WARNING in kvm_apic_accept_events (2)

On Tue, Nov 25, 2025, syzbot wrote:
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    8a2bcda5e139 Merge tag 'for-6.18/dm-fixes' of git://git.ke..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=1604f8b4580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=a1db0fea040c2a9f
> dashboard link: https://syzkaller.appspot.com/bug?extid=59f2c3a3fc4f6c09b8cd
> compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13ecf612580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13d9cf42580000
> 
> Downloadable assets:
> disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-8a2bcda5.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/fc3f96645396/vmlinux-8a2bcda5.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/e20aa7be5d33/bzImage-8a2bcda5.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+59f2c3a3fc4f6c09b8cd@...kaller.appspotmail.com
> 
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 5495 at arch/x86/kvm/lapic.c:3483 kvm_apic_accept_events+0x341/0x490 arch/x86/kvm/lapic.c:3483
> Modules linked in:
> CPU: 0 UID: 0 PID: 5495 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
> RIP: 0010:kvm_apic_accept_events+0x341/0x490 arch/x86/kvm/lapic.c:3483
> Code: eb 0c e8 32 da 71 00 eb 05 e8 2b da 71 00 45 31 ff 44 89 f8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc e8 10 da 71 00 90 <0f> 0b 90 e9 ec fd ff ff 44 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 4f
> RSP: 0018:ffffc90002b2fbf0 EFLAGS: 00010293
> RAX: ffffffff814e3940 RBX: 0000000000000002 RCX: ffff88801f8ca480
> RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000002
> RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff814689b6
> R10: dffffc0000000000 R11: ffffed1002268008 R12: 0000000000000002
> R13: dffffc0000000000 R14: ffff888042c95c00 R15: ffff8880113402d8
> FS:  000055558ab60500(0000) GS:ffff88808d72f000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 0000200000002000 CR3: 0000000058d0b000 CR4: 0000000000352ef0
> Call Trace:
>  <TASK>
>  kvm_arch_vcpu_ioctl_get_mpstate+0x128/0x480 arch/x86/kvm/x86.c:12147
>  kvm_vcpu_ioctl+0x625/0xe90 virt/kvm/kvm_main.c:4539
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:597 [inline]
>  __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
>  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
>  do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
> RIP: 0033:0x7f918bd8f749
> Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007ffc74a3c2a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007f918bfe5fa0 RCX: 00007f918bd8f749
> RDX: 0000000000000000 RSI: 000000008004ae98 RDI: 0000000000000005
> RBP: 00007f918be13f91 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 00007f918bfe5fa0 R14: 00007f918bfe5fa0 R15: 0000000000000003
>  </TASK>

Syzbot outsmarted me once again.  I thought I had made this impossible in commit
0fe3e8d804fd ("KVM: x86: Move INIT_RECEIVED vs. INIT/SIPI blocked check to KVM_RUN"),
but now syzkaller is triggering the WARN by swapping the order and stuffing VMXON
after INIT (ignore the EINVAL, KVM gets through enter_vmx_operation() before detecting
bad guest state).

  ioctl(5, KVM_SET_MP_STATE, 0x200000000000) = 0
  ioctl(5, KVM_SET_NESTED_STATE, 0x200000000a80) = -1 EINVAL (Invalid argument)
  ioctl(5, KVM_GET_MP_STATE, 0)           = -1 EFAULT (Bad address)

At this point, I'm leaning strongly towards dropping the WARN as it's not helping,
and userspace doing odd things is completely uninteresting.

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 7b1b8f450f4c..df2a69da11b7 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -3521,7 +3521,6 @@ int kvm_apic_accept_events(struct kvm_vcpu *vcpu)
         * wait-for-SIPI (WFS).
         */
        if (!kvm_apic_init_sipi_allowed(vcpu)) {
-               WARN_ON_ONCE(vcpu->arch.mp_state == KVM_MP_STATE_INIT_RECEIVED);
                clear_bit(KVM_APIC_SIPI, &apic->pending_events);
                return 0;
        }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ