public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [kvm-x86?] WARNING in kvm_apic_accept_events
@ 2025-06-05 13:08 syzbot
  2025-06-05 13:15 ` Sean Christopherson
  2025-10-12  2:53 ` syzbot
  0 siblings, 2 replies; 4+ messages in thread
From: syzbot @ 2025-06-05 13:08 UTC (permalink / raw)
  To: bp, dave.hansen, hpa, kvm, linux-kernel, mingo, pbonzini, seanjc,
	syzkaller-bugs, tglx, x86

Hello,

syzbot found the following issue on:

HEAD commit:    64980441d269 Merge tag 'bpf-fixes' of git://git.kernel.org..
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=145b31d4580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=73696606574e3967
dashboard link: https://syzkaller.appspot.com/bug?extid=b1784a9a955885da51cd
compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=110fcc0c580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16340c0c580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/b721c3fbaf59/disk-64980441.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b28b1e530885/vmlinux-64980441.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5aee07cc8b41/bzImage-64980441.xz

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

------------[ cut here ]------------
WARNING: CPU: 0 PID: 5841 at arch/x86/kvm/lapic.c:3407 kvm_apic_accept_events+0x341/0x490 arch/x86/kvm/lapic.c:3407
Modules linked in:
CPU: 0 UID: 0 PID: 5841 Comm: syz-executor279 Not tainted 6.15.0-syzkaller-12058-g64980441d269 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
RIP: 0010:kvm_apic_accept_events+0x341/0x490 arch/x86/kvm/lapic.c:3407
Code: eb 0c e8 62 7b 72 00 eb 05 e8 5b 7b 72 00 45 31 ff 44 89 f8 5b 41 5c 41 5d 41 5e 41 5f 5d e9 16 99 1a 0a cc e8 40 7b 72 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:ffffc9000433f5c8 EFLAGS: 00010293
RAX: ffffffff814de090 RBX: 0000000000000002 RCX: ffff88802a735a00
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000002
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff81463863
R10: dffffc0000000000 R11: fffffbfff1f4201f R12: 0000000000000002
R13: dffffc0000000000 R14: ffff888030df4600 R15: ffff888031a682d8
FS:  0000555566bb6380(0000) GS:ffff888125c55000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000002000 CR3: 0000000075360000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 vcpu_block arch/x86/kvm/x86.c:11298 [inline]
 vcpu_run+0x76f/0x6f70 arch/x86/kvm/x86.c:11335
 kvm_arch_vcpu_ioctl_run+0xfc9/0x1940 arch/x86/kvm/x86.c:11656
 kvm_vcpu_ioctl+0x95c/0xe90 virt/kvm/kvm_main.c:4461
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc83ec5e2f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff37b1fa98 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00007fc83ec5e2f9
RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000005
RBP: 0000200000bfe000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff37b1fac0
R13: 0000200000bff000 R14: 0000000000000004 R15: 0000000000000001
 </TASK>


---
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.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

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

* Re: [syzbot] [kvm-x86?] WARNING in kvm_apic_accept_events
  2025-06-05 13:08 [syzbot] [kvm-x86?] WARNING in kvm_apic_accept_events syzbot
@ 2025-06-05 13:15 ` Sean Christopherson
  2025-10-12  2:53 ` syzbot
  1 sibling, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2025-06-05 13:15 UTC (permalink / raw)
  To: syzbot
  Cc: bp, dave.hansen, hpa, kvm, linux-kernel, mingo, pbonzini,
	syzkaller-bugs, tglx, x86

On Thu, Jun 05, 2025, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    64980441d269 Merge tag 'bpf-fixes' of git://git.kernel.org..
> git tree:       upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=145b31d4580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=73696606574e3967
> dashboard link: https://syzkaller.appspot.com/bug?extid=b1784a9a955885da51cd
> compiler:       Debian clang version 20.1.6 (++20250514063057+1e4d39e07757-1~exp1~20250514183223.118), Debian LLD 20.1.6
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=110fcc0c580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16340c0c580000
> 
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/b721c3fbaf59/disk-64980441.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/b28b1e530885/vmlinux-64980441.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/5aee07cc8b41/bzImage-64980441.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+b1784a9a955885da51cd@syzkaller.appspotmail.com
> 
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 5841 at arch/x86/kvm/lapic.c:3407 kvm_apic_accept_events+0x341/0x490 arch/x86/kvm/lapic.c:3407
> Modules linked in:
> CPU: 0 UID: 0 PID: 5841 Comm: syz-executor279 Not tainted 6.15.0-syzkaller-12058-g64980441d269 #0 PREEMPT(full) 
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
> RIP: 0010:kvm_apic_accept_events+0x341/0x490 arch/x86/kvm/lapic.c:3407

Pretty straightforward; syzkaller sets MP_STATE to INIT_RECEIVED, and then
stuffs vmxon.  KVM, courtesy of commit 28bf28887976 ("KVM: x86: fix user
triggerable warning in kvm_apic_accept_events()"), only guards against the
opposite ordering.

Rather than play a losing game of whack-a-mole with ioctl ordering (SVM's GIF=0
case is even harder to deal with), I'm going to modify KVM to wait until KVM_RUN
to enforce the check, similar to how KVM handles the scenario where emulation is
required (due to !URG) but KVM can't emulate.

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

* Re: [syzbot] [kvm-x86?] WARNING in kvm_apic_accept_events
  2025-06-05 13:08 [syzbot] [kvm-x86?] WARNING in kvm_apic_accept_events syzbot
  2025-06-05 13:15 ` Sean Christopherson
@ 2025-10-12  2:53 ` syzbot
  2025-10-13 13:37   ` Sean Christopherson
  1 sibling, 1 reply; 4+ messages in thread
From: syzbot @ 2025-10-12  2:53 UTC (permalink / raw)
  To: bp, dave.hansen, hpa, kvm, linux-kernel, mingo, pbonzini, seanjc,
	syzkaller-bugs, tglx, x86

syzbot suspects this issue was fixed by commit:

commit 0fe3e8d804fdcc09ef44fbffcad8c39261a03470
Author: Sean Christopherson <seanjc@google.com>
Date:   Thu Jun 5 19:50:17 2025 +0000

    KVM: x86: Move INIT_RECEIVED vs. INIT/SIPI blocked check to KVM_RUN

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1585c9e2580000
start commit:   64980441d269 Merge tag 'bpf-fixes' of git://git.kernel.org..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=26abb92f9ef9d1d0
dashboard link: https://syzkaller.appspot.com/bug?extid=b1784a9a955885da51cd
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12200c0c580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16fd31d4580000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: KVM: x86: Move INIT_RECEIVED vs. INIT/SIPI blocked check to KVM_RUN

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

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

* Re: [syzbot] [kvm-x86?] WARNING in kvm_apic_accept_events
  2025-10-12  2:53 ` syzbot
@ 2025-10-13 13:37   ` Sean Christopherson
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2025-10-13 13:37 UTC (permalink / raw)
  To: syzbot
  Cc: bp, dave.hansen, hpa, kvm, linux-kernel, mingo, pbonzini,
	syzkaller-bugs, tglx, x86

On Sat, Oct 11, 2025, syzbot wrote:
> syzbot suspects this issue was fixed by commit:
> 
> commit 0fe3e8d804fdcc09ef44fbffcad8c39261a03470
> Author: Sean Christopherson <seanjc@google.com>
> Date:   Thu Jun 5 19:50:17 2025 +0000
> 
>     KVM: x86: Move INIT_RECEIVED vs. INIT/SIPI blocked check to KVM_RUN

Doh, I used the wrong Reported-by in the changelog.

> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1585c9e2580000
> start commit:   64980441d269 Merge tag 'bpf-fixes' of git://git.kernel.org..
> git tree:       upstream
> kernel config:  https://syzkaller.appspot.com/x/.config?x=26abb92f9ef9d1d0
> dashboard link: https://syzkaller.appspot.com/bug?extid=b1784a9a955885da51cd
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12200c0c580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16fd31d4580000
> 
> If the result looks correct, please mark the issue as fixed by replying with:
> 
> #syz fix: KVM: x86: Move INIT_RECEIVED vs. INIT/SIPI blocked check to KVM_RUN
> 
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection

#syz fix: KVM: x86: Move INIT_RECEIVED vs. INIT/SIPI blocked check to KVM_RUN

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

end of thread, other threads:[~2025-10-13 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 13:08 [syzbot] [kvm-x86?] WARNING in kvm_apic_accept_events syzbot
2025-06-05 13:15 ` Sean Christopherson
2025-10-12  2:53 ` syzbot
2025-10-13 13:37   ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox