Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177726354
D61732.1795139402.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61732.1795139402.diff
View Options
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -3343,6 +3343,12 @@
register_t *regp;
if ((regp = vmxctx_regptr(vmxctx, reg)) != NULL) {
+ /*
+ * DR6 is loaded into the host's register before guest entry,
+ * where setting any of bits 63:32 raises #GP.
+ */
+ if (reg == VM_REG_GUEST_DR6 && (val >> 32) != 0)
+ return (EINVAL);
*regp = val;
return (0);
} else
@@ -4172,6 +4178,7 @@
struct vmx *vmx;
struct vmx_vcpu *vcpu;
struct vmxctx *vmxctx;
+ uint64_t dr6;
int err, run, hostcpu;
err = 0;
@@ -4271,7 +4278,10 @@
SNAPSHOT_VAR_OR_LEAVE(vmxctx->guest_dr1, meta, err, done);
SNAPSHOT_VAR_OR_LEAVE(vmxctx->guest_dr2, meta, err, done);
SNAPSHOT_VAR_OR_LEAVE(vmxctx->guest_dr3, meta, err, done);
- SNAPSHOT_VAR_OR_LEAVE(vmxctx->guest_dr6, meta, err, done);
+ dr6 = vmxctx->guest_dr6;
+ SNAPSHOT_VAR_OR_LEAVE(dr6, meta, err, done);
+ if (meta->op == VM_SNAPSHOT_RESTORE)
+ err = vmxctx_setreg(vmxctx, VM_REG_GUEST_DR6, dr6);
done:
return (err);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 20, 1:50 AM (8 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41855435
Default Alt Text
D61732.1795139402.diff (1 KB)
Attached To
Mode
D61732: amd64/vmm: Reject reserved DR6 bits supplied by userspace
Attached
Detach File
Event Timeline