VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Driver
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-04 11:19:53 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-04 12:28:17 +0200
commit88cc8a00f4a7fc34003b961c572d5a78462dd682 (patch)
treec34058cc9b899791f5b26a0c01955198cd0953d4 /src/Driver
parent0358eb6c717cfe132bcec7fddeac14213ed8937c (diff)
downloadVeraCrypt-88cc8a00f4a7fc34003b961c572d5a78462dd682.tar.gz
VeraCrypt-88cc8a00f4a7fc34003b961c572d5a78462dd682.zip
Windows: correctly handle SEH exceptions during self-tests in order to disable CPU extended features in such case.
Diffstat (limited to 'src/Driver')
-rw-r--r--src/Driver/DumpFilter.c14
-rw-r--r--src/Driver/Ntdriver.c11
2 files changed, 12 insertions, 13 deletions
diff --git a/src/Driver/DumpFilter.c b/src/Driver/DumpFilter.c
index 18feca06..2b58d061 100644
--- a/src/Driver/DumpFilter.c
+++ b/src/Driver/DumpFilter.c
@@ -66,18 +66,8 @@ NTSTATUS DumpFilterEntry (PFILTER_EXTENSION filterExtension, PFILTER_INITIALIZAT
if (filterExtension->DumpType == DumpTypeCrashdump)
{
dumpConfig.HwEncryptionEnabled = FALSE;
- // disable also SSE optimizations
- HasMMX() = 0;
- HasISSE() = 0;
- HasSSE2() = 0;
- HasSSSE3() = 0;
- HasSSE41() = 0;
- HasSSE42() = 0;
- HasAESNI() = 0;
- HasCLMUL() = 0;
- HasSAVX() = 0;
- HasSAVX2() = 0;
- HasSBMI2() = 0;
+ // disable also CPU extended features used in optimizations
+ DisableCPUExtendedFeatures ();
}
#endif
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 8f6f151f..7ada065b 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -153,7 +153,16 @@ NTSTATUS DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
if (startKeyValue->Type == REG_DWORD && *((uint32 *) startKeyValue->Data) == SERVICE_BOOT_START)
{
if (!SelfTestsPassed)
- TC_BUG_CHECK (STATUS_INVALID_PARAMETER);
+ {
+ // in case of system encryption, if self-tests fail, disable all extended CPU
+ // features and try again in order to workaround faulty configurations
+ DisableCPUExtendedFeatures ();
+ SelfTestsPassed = AutoTestAlgorithms();
+
+ // BUG CHECK if the self-tests still fail
+ if (!SelfTestsPassed)
+ TC_BUG_CHECK (STATUS_INVALID_PARAMETER);
+ }
LoadBootArguments();
VolumeClassFilterRegistered = IsVolumeClassFilterRegistered();