FS#8163 - util-linux-ng/loop-aes: unable to mount filesystems created and encrypted with util-linux

Attached to Project: Arch Linux
Opened by Michał Gawron (mcv) - Saturday, 29 September 2007, 21:55 GMT
Last edited by Tobias Powalowski (tpowa) - Monday, 01 October 2007, 17:42 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture i686
Severity Critical
Priority Normal
Reported Version 2007.08.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

After upgrading util-linux to util-linux-ng (2.13-1) I'm unable to mount filesystems encrypted with util-linux utilities. I use `losetup -e aes-256 /dev/loop/X file-with-filesystem` (encryption=aes-256 in fstab). After upgrade losetup works (asks for password) and creates looped device on /dev/loop/X, but data on it is still somewhat encrypted (but differs from original file-with-filesystem). It works the way if I entered wrong password, loop-aes decrypts data but not to original filesystem but instead to another data mess.

Downgrading to util-linux-2.12-12 solves the problem.

Additional info:
* package version(s)
- works with util-linux-2.12-12
- dowsn't work with util-linux-ng-2.13-1
* config and/or log files etc.
- no usable information is found in dmesg nor log files. When mounting
(not only creating loop-dev) kernel only says that it was unable to
find proper ext3 (in my case) filesystem.

Steps to reproduce:
Create encrypted loop-aes file using util-linux-2.12-12:
# dd if=/dev/zero of=encryptedfile bs=1M count=10
Create encrypted loop device (/dev/loop/0 as example, may be need to use another number):
# losetup -e aes-256 /dev/loop/0 encryptedfile
Losetup will ask for passphrase, so use at least 20 characters length password.
After this create filesystem on encrypted-loop:
# mkfs.ext3 /dev/loop/0
Now mount the filesystem somewhere:
# mount /dev/loop/0 /mnt/temp
and copy some files there.
Unmount and deassign loop:
# umount /mnt/temp
# losetup -d /dev/loop/0
Upgrade util-linux to util-linux-ng with Pacman.
Try to losetup (everything will go well):
# losetup -e aes-256 /dev/loop/0 encryptedfile
Enter the same password. On /dev/loop/0 should appear valid ext3 filesystem, but instead
there is a data mess (invalid deencryption as if the password was invalid). This will of course
result in inability to mount filesystem:
# mount /dev/loop/0 /mnt/temp
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Monday, 01 October 2007, 17:42 GMT
Reason for closing:  Fixed
Comment by Thomas Bächler (brain0) - Sunday, 30 September 2007, 09:43 GMT
See this posting (or the whole thread):
http://archlinux.org/pipermail/arch/2007-September/015485.html

Try the option -H unhashed2 to losetup.

Note that cryptoloop is deprecated and should not be used, as there is no standard ensuring compatibility with newer versions. In fact, this has happened to many users of many distributions in the past after upgrades. If you seriously want to use encryption, use dm-crypt/LUKS.
Comment by Tobias Powalowski (tpowa) - Monday, 01 October 2007, 17:37 GMT
can we close this then?
Comment by Michał Gawron (mcv) - Monday, 01 October 2007, 17:41 GMT
brain0: This works. BTW, I'm currently changing cryptoloop to LUKS.
tpowa: Sure.

Loading...