You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
debug("CPU_HEURISTIC: Hypervisor reports RDRAND, but it is not handled correctly");
9461
+
returntrue;
9462
+
}
9463
+
}
9464
+
9465
+
// 2. Test if the CPU vendor is spoofed (for example, a CPU reports being AMD in CPUID, but it is Intel)
9406
9466
/*
9407
-
For this task, we want a vendor-only instruction that:
9408
-
1. Is compatible enough, meaning both old and new CPUs of this vendor have it
9409
-
2. Is enabled by default, without needing BIOS/OS changes
9410
-
3. Never switches to kernel-mode, so that is harder to intercept
9411
-
4. Is not deprecated
9467
+
For this task, we want a instruction that:
9468
+
1. It is vendor-only, meaning that other CPU vendors never implemented the same instruction on their microcode
9469
+
-> Note: Even if an instruction is vendor-only, it may be treated as a NOP by other CPU vendors, we don't want this
9470
+
2. Is compatible enough, meaning both old and new CPUs of this vendor have it
9471
+
3. Is enabled by default, without needing BIOS/OS changes
9472
+
4. Never switches to kernel-mode, so that is harder to intercept
9473
+
5. Is not deprecated today
9474
+
6. Its side-effects can be measured from CPL3 (user-mode)
9412
9475
9413
9476
On Intel, most options are unreliable:
9414
-
SGX are deprecated and disabled by default, MPX is deprecated and treated as NOP even in AMD CPUs, AVX-512 is not found in all processors (and amd integrated part of this set), etc
9477
+
SGX are deprecated and disabled by default, MPX is deprecated and treated as NOP even in AMD CPUs, AVX-512 is not found in all processors (and AMD integrated part of this set), etc
9415
9478
On AMD, 3dNow! could be an option, but since its being deprecated, CLZERO fits this criteria better
9416
9479
9417
9480
So for example, if the CPU reports being Intel, and succesfully runs CLZERO without a NOP, then it's not an Intel CPU.
@@ -9440,7 +9503,8 @@ struct VM {
9440
9503
constbool claimed_intel = cpu::is_intel();
9441
9504
9442
9505
if (!claimed_amd && !claimed_intel) {
9443
-
returnfalse;
9506
+
debug("CPU_HEURISTIC: x86 CPU vendor was not recognized as either Intel or AMD");
9507
+
returnfalse; // Zhaoxin? VIA/Centaur?
9444
9508
}
9445
9509
9446
9510
bool spoofed = false;
@@ -9578,6 +9642,9 @@ struct VM {
9578
9642
}
9579
9643
9580
9644
return spoofed;
9645
+
#else
9646
+
returnfalse;
9647
+
#endif
9581
9648
}
9582
9649
9583
9650
@@ -10962,8 +11029,6 @@ struct VM {
10962
11029
return it->second;
10963
11030
}
10964
11031
10965
-
debug("VM::type(): No known brand found, something went terribly wrong here...");
0 commit comments