diff --git a/src/Core/Unix/CoreUnix.cpp b/src/Core/Unix/CoreUnix.cpp index 1344f9e0..5525ab9c 100644 --- a/src/Core/Unix/CoreUnix.cpp +++ b/src/Core/Unix/CoreUnix.cpp @@ -306,7 +306,8 @@ namespace VeraCrypt #endif catch (NotApplicable &) { } - if (!mountedVolume->LoopDevice.IsEmpty()) + // Earlier versions recorded the host device of a device-hosted volume mounted with Linux kernel cryptography as its loop device + if (!mountedVolume->LoopDevice.IsEmpty() && wstring (mountedVolume->LoopDevice) != wstring (mountedVolume->Path)) { try { @@ -410,7 +411,8 @@ namespace VeraCrypt firstException.reset (e.CloneNew()); } - if (!mountedVolume->LoopDevice.IsEmpty()) + // Earlier versions recorded the host device of a device-hosted volume mounted with kernel cryptography as its loop device + if (!mountedVolume->LoopDevice.IsEmpty() && wstring (mountedVolume->LoopDevice) != wstring (mountedVolume->Path)) { try { diff --git a/src/Core/Unix/Linux/CoreLinux.cpp b/src/Core/Unix/Linux/CoreLinux.cpp index 3c7f6692..922c65a4 100644 --- a/src/Core/Unix/Linux/CoreLinux.cpp +++ b/src/Core/Unix/Linux/CoreLinux.cpp @@ -651,7 +651,11 @@ namespace VeraCrypt filesystemMounted = true; } - FuseService::SendAuxDeviceInfo (auxMountPoint, nativeDevPath, volumePath); + // Dismounting detaches the recorded loop device, so record only one attached above + if (loopDevAttached) + FuseService::SendAuxDeviceInfo (auxMountPoint, nativeDevPath, volumePath); + else + FuseService::SendAuxDeviceInfo (auxMountPoint, nativeDevPath); } catch (...) {