Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111870651
D13919.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13919.diff
View Options
Index: sys/amd64/vmm/amd/svm_support.S
===================================================================
--- sys/amd64/vmm/amd/svm_support.S
+++ sys/amd64/vmm/amd/svm_support.S
@@ -124,9 +124,21 @@
pop %rdx
mov %edx, %eax
shr $32, %rdx
- mov $MSR_GSBASE, %ecx
+ mov $MSR_GSBASE, %rcx
wrmsr
+ /*
+ * Clobber the remaining registers with guest contents so they
+ * can't be misused.
+ */
+ xor %rbp, %rbp
+ xor %rdi, %rdi
+ xor %rsi, %rsi
+ xor %r8, %r8
+ xor %r9, %r9
+ xor %r10, %r10
+ xor %r11, %r11
+
VLEAVE
ret
END(svm_launch)
Index: sys/amd64/vmm/intel/vmx_support.S
===================================================================
--- sys/amd64/vmm/intel/vmx_support.S
+++ sys/amd64/vmm/intel/vmx_support.S
@@ -72,6 +72,20 @@
movq VMXCTX_GUEST_RDI(%rdi),%rdi; /* restore rdi the last */
/*
+ * Clobber the remaining registers with guest contents so they can't
+ * be misused.
+ */
+#define VMX_GUEST_CLOBBER \
+ xor %rax, %rax; \
+ xor %rcx, %rcx; \
+ xor %rdx, %rdx; \
+ xor %rsi, %rsi; \
+ xor %r8, %r8; \
+ xor %r9, %r9; \
+ xor %r10, %r10; \
+ xor %r11, %r11;
+
+/*
* Save and restore the host context.
*
* Assumes that %rdi holds a pointer to the 'vmxctx'.
@@ -232,6 +246,8 @@
VMX_HOST_RESTORE
+ VMX_GUEST_CLOBBER
+
/*
* This will return to the caller of 'vmx_enter_guest()' with a return
* value of VMX_GUEST_VMEXIT.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 10, 2:45 PM (16 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17085432
Default Alt Text
D13919.diff (1 KB)
Attached To
Mode
D13919: mitigate against CVE-2017-5715 by clearing registers upon returning from the guest
Attached
Detach File
Event Timeline
Log In to Comment