⬢ DragonFlyBSD Kernel Audit
DF-5408 / fix.diff
← back to finding ↓ download raw
--- a/sys/platform/vkernel64/x86_64/cpu_regs.c	2026-10-04 10:13:11.064985762 +0000
+++ b/sys/platform/vkernel64/x86_64/cpu_regs.c	2026-10-04 10:13:11.068985712 +0000
@@ -312,8 +312,8 @@
 {
 	frame->tf_cs = _ucodesel;
 	frame->tf_ss = _udatasel;
-	/* XXX VM (8086) mode not supported? */
-	frame->tf_rflags &= (PSL_RF | PSL_USERCHANGE | PSL_VM_UNSUPP);
+	/* VM (8086) mode not supported: strip it */
+	frame->tf_rflags &= (PSL_RF | PSL_USERCHANGE);
 	frame->tf_rflags |= PSL_RESERVED_DEFAULT | PSL_I;
 
 	return(0);
@@ -365,9 +365,6 @@
 	ucp = &uc;
 	rflags = ucp->uc_mcontext.mc_rflags;
 
-	/* VM (8086) mode not supported */
-	rflags &= ~PSL_VM_UNSUPP;
-
 #if 0
 	if (eflags & PSL_VM) {
 		struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs;
--- a/sys/platform/pc64/x86_64/machdep.c	2026-10-04 10:13:11.068985712 +0000
+++ b/sys/platform/pc64/x86_64/machdep.c	2026-10-04 10:13:11.068985712 +0000
@@ -909,8 +909,8 @@
 {
 	frame->tf_cs = _ucodesel;
 	frame->tf_ss = _udatasel;
-	/* XXX VM (8086) mode not supported? */
-	frame->tf_rflags &= (PSL_RF | PSL_USERCHANGE | PSL_VM_UNSUPP);
+	/* VM (8086) mode not supported: strip it */
+	frame->tf_rflags &= (PSL_RF | PSL_USERCHANGE);
 	frame->tf_rflags |= PSL_RESERVED_DEFAULT | PSL_I;
 
 	return(0);
@@ -964,9 +964,6 @@
 	ucp = &uc;
 	rflags = ucp->uc_mcontext.mc_rflags;
 
-	/* VM (8086) mode not supported */
-	rflags &= ~PSL_VM_UNSUPP;
-
 #if 0 /* JG */
 	if (eflags & PSL_VM) {
 		struct trapframe_vm86 *tf = (struct trapframe_vm86 *)regs;