View previous topic :: View next topic |
Author |
Message |
pent0z Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 17 May 2003 Posts: 131
|
Posted: Tue Jul 29, 2003 6:50 am Post subject: losetup in util-linux-2.12 missing -k switch ? |
|
|
hi, i've upgraded util-linux to 2.12 but after this i can't start /etc/init.d/crypto-loop because the new /sbin/losetup doesn't have the -k switch... this has caused a lot of problem (my server has /home encrypted)
please check |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pent0z Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 17 May 2003 Posts: 131
|
Posted: Tue Jul 29, 2003 7:18 am Post subject: |
|
|
i've lost a LOT of e-mail for this FUCKED losetup since my /home is on a encrypted filesystem...
thanks.. COOL! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
markan18 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/18405332353f90ba828b57f.jpg)
Joined: 17 Apr 2003 Posts: 11 Location: wonderland
|
Posted: Wed Jul 30, 2003 4:26 am Post subject: losetup mess |
|
|
I presume you have upgraded your kernel to 2.6.0test2. Do you see an error message like this "LOOP_SET_STATUS invalid argument" when trying to mount your encrypted home? It seems than loopback encrypted filesystem using kernel 2.4 are incompatible with kernel 2.6 and losetup have changed also. I've had the same problem and here is what i've done.
1- copy encrypted loopback filesystem in a machine that still use kernel 2.4 and the old losetup.
2- Mount the encrypted filesystem in that machine.
3- Create a new encrypted filesystem in the machine that uses the kernel 2.6.0 and the new losetup and mount it.
4- Using ssh, copy files from the old encrypted filesystem to the new one
5- Keep a backup of the old encrypted filesystem and a backup of a working installation that can decrypt your old encrypted filesystem, you may need it.
I wonder what keysize the new losetup uses since we can't control it anymore, it may depends of the length of the password.. _________________ emerge -u beer |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Jake Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 31 Jul 2003 Posts: 1132
|
Posted: Fri Aug 01, 2003 3:01 pm Post subject: |
|
|
From what I've found, the new losetup defaults to 256bit keys. If you want to use something else, I think the proper syntax is "losetup -e aes128...", for example. The trouble I've been having, however, seems to be the lack of support for hash algorithms. Note how the new losetup has no -P option.
The new mount at least supports the old syntax. For example, in 2.6.0-test2 with util-linux 2.12, I can do "mount -t ext2 -o loop=/dev/loop0,encryption=twofish,keysize=256,phash=sha512 somefile somedirectory". The file I create fails to mount in 2.4. The same goes for files created in 2.4 when I try to mount them in 2.6.
I was reading the mailing list and I found that AES support is known to be broken. They claim the kerneli version was wrong. There's an easy mistake you can make implementing AES, and kerneli made it. There was no mention of other algorithms like twofish being wrong.
I think I've found a workaround for the hash problem. losetup 2.12 has the ability to read a passphrase from a file like this: "get_passphrase | mount -o loop,encryption=aes -p0 dev dir". All one would have to do is hack the desired hash algorithm out of the kerneli patch and turn it into a simple C program, get_passphrase. If I'm right and the hash is the problem, I'd really like to resolve it rather than just switch to a hashless implementation. I fear without the hash it would be less secure, but I could be wrong. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bpardy n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 14 Aug 2003 Posts: 3
|
Posted: Thu Aug 14, 2003 11:24 pm Post subject: Re: losetup mess |
|
|
markan18 wrote: | I presume you have upgraded your kernel to 2.6.0test2. Do you see an error message like this "LOOP_SET_STATUS invalid argument" when trying to mount your encrypted home? It seems than loopback encrypted filesystem using kernel 2.4 are incompatible with kernel 2.6 and losetup have changed also. I've had the same problem and here is what i've done.
1- copy encrypted loopback filesystem in a machine that still use kernel 2.4 and the old losetup.
2- Mount the encrypted filesystem in that machine.
3- Create a new encrypted filesystem in the machine that uses the kernel 2.6.0 and the new losetup and mount it.
4- Using ssh, copy files from the old encrypted filesystem to the new one
5- Keep a backup of the old encrypted filesystem and a backup of a working installation that can decrypt your old encrypted filesystem, you may need it.
I wonder what keysize the new losetup uses since we can't control it anymore, it may depends of the length of the password.. |
Any suggestions for those of us having this problem that did NOT upgrade to 2.6.0-anything, and then managed to kill their encrypted filesystems with this fucked up util-linux 2.12?
Does anybody have a binary for a WORKING losetup pre-2.12 that doesn't completely suck ass?
I did NOT upgrade my kernel, but upgrading util-linux has completely eliminated my ability to mount my encrypted filesystems. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Mukka42 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 13 Nov 2003 Posts: 18
|
Posted: Sun Dec 21, 2003 11:55 am Post subject: under 2.4 downgrade! |
|
|
Simply downgrade you util-linux package to 2.11
Code: | Stoppos szelm # emerge /usr/portage/sys-apps/util-linux/util-linux-2.11z-r9.ebuild
|
Or burn a Knoppix and mount the encryptred /home...
Mukka |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
_puck_ Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/d953184a3cde3e924d3c8.jpg)
Joined: 12 May 2002 Posts: 111 Location: Kaiserslautern / Germany
|
Posted: Tue Dec 23, 2003 12:16 pm Post subject: |
|
|
@markan18
Quote: |
3- Create a new encrypted filesystem in the machine that uses the kernel 2.6.0 and the new losetup and mount it.
|
But how?
Code: |
coruscant crypto # !dd
dd if=/dev/urandom of=test bs=512 count=10000
10000+0 records in
10000+0 records out
coruscant crypto # losetup -e serpent -E 32 /dev/loop0 test
Password:
ioctl: LOOP_SET_STATUS: Invalid argument
coruscant crypto # uname -r
2.6.0
coruscant crypto # emerge -pv util-linux
These are the packages that I would merge, in order:
Calculating dependencies ...done!
[ebuild R ] sys-apps/util-linux-2.12-r3 +crypt +nls -static +pam -selinux
|
_________________ regards
puck
___________________________
#There is more than one way to do it. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
trapni Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
Joined: 16 May 2002 Posts: 251 Location: Germany/Berlin
|
Posted: Mon Jan 05, 2004 10:04 pm Post subject: |
|
|
dunno whether still ontopic, but I could switch to new util-linux with 2.6 and crypto as fast as on-the-fly.
I previousely mounted with mount options encryption=aes,keybits=128,phash=sha512 for kernel 2.4 and old util-linux (2.11z...)
with kernel 2.6 and new util-linux I could mount this with the command:
hashalot sha512 | losetup -p 0 -e aes-cbc-128 /dev/loop/0 /dev/hdc1 && mount /dev/loop/0 /home.
the keybits is passed as part of the encryption algorithm. Of course, /dev/hdc1 has to be changed to your needs, as well as the mount point (here: /home).
Unfortunately, gentoo doesn't seem to have official support for crypto-loop and util-linux-2.12 (that works with 2.6 *and* 2.4 kernel)
greets,
Christian Parpart. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|