1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-28 08:07:03 +00:00

Handle VMMCALL in vctrap()

When SEV guest userland issues a vmmcall instruction, a #VC exception
with code SVM_VMEXIT_VMMCALL will be raised in the guest kernel.
For now we do not allow vmmcalls from guest userland, thus terminate
the userland process with SIGILL.

This is similar to the non-SEV case.

ok mlarkin@
This commit is contained in:
hshoexer
2026-02-16 15:10:39 +00:00
parent c1737a4202
commit 881362e4e1

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: trap.c,v 1.116 2025/11/26 13:48:57 sf Exp $ */
/* $OpenBSD: trap.c,v 1.117 2026/02/16 15:10:39 hshoexer Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@@ -437,6 +437,14 @@ vctrap(struct trapframe *frame, int user, int *sig, int *code)
}
break;
}
case SVM_VMEXIT_VMMCALL:
if (user) {
*sig = SIGILL;
*code = ILL_PRVOPC;
return 0; /* not allowed from userspace */
}
panic("unexpected VMMCALL in kernelspace");
/* NOTREACHED */
case SVM_VMEXIT_NPF:
if (user) {
*sig = SIGBUS;