bwalex / tc-play

Free and simple TrueCrypt/VeraCrypt Implementation based on dm-crypt
BSD 2-Clause "Simplified" License
551 stars 56 forks source link

tcplay hangs at the device mapper stage #71

Closed vr00m closed 4 years ago

vr00m commented 7 years ago

I experienced the same issue mentioned here After interrupting the hung tcplay, I was unable to detach the encrypted file from the loop device:

sudo losetup -d /dev/loop0 (returns the prompt, with no errors)

But, lsof | grep loop0 returns

loop0 2465 root cwd unknown /proc/2465/cwd (readlink: Permission denied) loop0 2465 root rtd unknown /proc/2465/root (readlink: Permission denied) loop0 2465 root txt unknown /proc/2465/exe (readlink: Permission denied) loop0 2465 root NOFD /proc/2465/fd (opendir: Permission denied)

and, kill -9 2465 does not work

famzah commented 7 years ago

The eternal wait happens at the last dm_udev_wait(cookie) in "tcplay.c" line 1846. It's probably some problem in the "udev" rules. Executing udevadm monitor --udev --env shows that the DM-device is being successfully created but some post actions are missing and dm_udev_wait(cookie) waits forever.

If I comment out the last dm_udev_wait(cookie) in "tcplay.c" and recompile, then the mount succeeds with the following warning:

/dev/mapper/backup17 not set up by udev: Falling back to direct node creation.

Here "backup17" is the mapping name that I chose for my encrypted block device.

famzah commented 7 years ago

I managed to get the Ubuntu/Debian package working as well. You need to additionally install dmsetup:

apt-get install dmsetup

This package installs the following "udev" rules which probably resolve the issue:

/lib/udev/rules.d/55-dm.rules
/lib/udev/rules.d/60-persistent-storage-dm.rules
famzah commented 7 years ago

@bwalex, maybe you can mention in the README that apt-get install dmsetup is required for the latest Debian/Ubuntu systems.

Seb35 commented 6 years ago

Ubuntu packaging bug: https://bugs.launchpad.net/ubuntu/+source/tcplay/+bug/1625822

Seb35 commented 6 years ago

This is a Ubuntu-specific packaging bug, there is no issue with Debian.

Tested on Debian 8 and 9, and Ubuntu 16.04 LTS and 18.04 LTS. In both distros tcplay depends on libdevmapper1.02.1, but this last one depends on dmsetup on Debian but is only a recommendation on Ubuntu.

bwalex commented 4 years ago

This seems like a distro package problem - that's where the dependency should be defined.