svn commit: r284046 - head/sys/amd64/vmm
Neel Natu
neel at FreeBSD.org
Fri Jun 5 21:22:27 UTC 2015
Author: neel
Date: Fri Jun 5 21:22:26 2015
New Revision: 284046
URL: https://svnweb.freebsd.org/changeset/base/284046
Log:
The 'verify_gla()' function is used to ensure that the effective address
after decoding the instruction matches the one provided by hardware.
Prior to r283293 'vie->num_valid' used to contain the actual length of
the instruction whereas now it contains the maximum instruction length
possible. This introduced a bug when calculating a RIP-relative base address.
Fix this by using 'vie->num_processed' rather than 'vie->num_valid' as the
length of the emulated instruction.
Reported and tested by: tychon
MFC after: 1 week
Modified:
head/sys/amd64/vmm/vmm_instruction_emul.c
Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==============================================================================
--- head/sys/amd64/vmm/vmm_instruction_emul.c Fri Jun 5 20:38:22 2015 (r284045)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c Fri Jun 5 21:22:26 2015 (r284046)
@@ -2342,7 +2342,7 @@ verify_gla(struct vm *vm, int cpuid, uin
* instruction
*/
if (vie->base_register == VM_REG_GUEST_RIP)
- base += vie->num_valid;
+ base += vie->num_processed;
}
idx = 0;
More information about the svn-src-all
mailing list