Prevent bug checks due to race conditions

Zeroing the read access before the write access can result in
an ept misconfiguration (page writable, but not readable) if a
separate core accesses the same page inbetween the zeroing.
This commit is contained in:
momo5502 2022-05-16 12:39:59 +02:00
parent 7c1e10d164
commit ab6e9808b5

View File

@ -101,8 +101,8 @@ namespace vmx
{
if (watch_point->target_page)
{
watch_point->target_page->read_access = 0;
watch_point->target_page->write_access = 0;
watch_point->target_page->read_access = 0;
watch_point->target_page->execute_access = 1;
}
@ -261,8 +261,8 @@ namespace vmx
if (!violation_qualification.ept_executable && violation_qualification.execute_access)
{
watch_point->target_page->execute_access = 1;
watch_point->target_page->read_access = 0;
watch_point->target_page->write_access = 0;
watch_point->target_page->read_access = 0;
guest_context.increment_rip = false;
}
else if (violation_qualification.ept_executable && (violation_qualification.read_access ||