Files
VeraCrypt/src/Core
Mounir IDRASSI a1dfce108d Linux: don't detach the host device of a device-hosted volume
MountVolumeNative attaches a loop device only for a volume in a file,
but it recorded the volume path as the loop device in every case. For
a volume on a block device mounted with kernel cryptography, that is
the host device itself, so DismountVolume and EmergencyDismountVolume
ran losetup -d on it. A loop device that the user had attached, for
example to open a volume inside a disk image, was detached, or marked
for autoclear when emergency cleanup ran while the filesystem was
busy. On other devices, such as partitions, losetup failed and was
retried for about 1.2 seconds before the error was ignored. This code
comes from TrueCrypt 7.1a.

Record the loop device only when MountVolumeNative attached one, as
its error path already does. A volume mounted by an earlier version
keeps its FUSE service after an upgrade, and that service still
reports the host device, so the unmount functions also skip a loop
device that is the volume's own path. A loop device that VeraCrypt
attached is never the volume path.

Validated with console builds as root, for volumes on a loop device,
on a partition of a loop device attached with --partscan, and with
--emergency-unmount while the filesystem was busy: losetup no longer
runs, the loop device stays attached, and the partition case unmounts
in 0.18 s instead of 1.43 s. The same holds when these volumes are
mounted by 1.26.29 and unmounted by this build. Volumes in files and
nokernelcrypto mounts still detach the loop device that VeraCrypt
attached, also when mounting fails.
2026-10-04 10:35:30 +09:00
..
2026-06-09 09:56:25 +09:00
2026-09-30 20:12:20 +09:00
2026-09-30 20:12:20 +09:00
2026-09-30 20:12:20 +09:00
2026-09-30 20:12:20 +09:00
2026-06-09 09:56:25 +09:00
2026-09-30 20:12:20 +09:00
2026-06-09 09:56:25 +09:00
2026-09-30 20:12:20 +09:00