[dm-crypt] dm-crypt hanging on attempts to manipulate an encrypted device

Pedro Fernandes Macedo pmacedo at gmail.com
Sun Apr 18 13:17:35 CEST 2010


I have a 1TB USB disk that I use for backups and has recently hit a snag.
 The encrypted device was working fine, but it now is failing on a weird
way: after plugging it in yesterday and doing a luksOpen, the "automatic
header conversion from 0.99 to 0.991 triggered" message appeared. After
that, every single attempt at opening the device or add keys hangs after the
key is entered. This is a device that was in use all the time and was
working until I unplugged it (for safety) for some changes to my raid
setup.

I've now removed the hard drive from its enclosure and put it directly on
the server, made an image and I am testing now using a loop device and the
image. Here's the interesting bits:

# cryptsetup luksDump /dev/loop1
LUKS header information for /dev/loop1

Version:        1
Cipher name:    aes
Cipher mode:    cbc-essiv:sha256
Hash spec:      sha1
Payload offset: 1032
MK bits:        128
MK digest:      b5 00 fe b8 fc a8 4a 21 9a 89 a2 cf 83 ac 0c de 93 50 cc 32
MK salt:        00 72 37 b0 f1 a1 55 e5 ba 0c 2b 0e 83 cc 54 1d
                8f 43 f5 12 9b 57 05 83 e0 7f 2a d6 3d df 1d d0
MK iterations:  0
UUID:           48d0bd7e-ef95-4e47-bda0-80c5d872087d

Key Slot 0: ENABLED
        Iterations:             148711
        Salt:                   34 eb 8d df 49 8e 5f 24 1c 1f 27 77 e9 fd 3d
b1
                                04 37 ea 66 81 77 8b 96 62 fc 3f a2 c8 c9 c3
87
        Key material offset:    8
        AF stripes:             4000
Key Slot 1: ENABLED
        Iterations:             183406
        Salt:                   73 23 9f 40 5a ea ae 50 7b 6b 59 77 e1 a3 f8
11
                                79 09 eb ce a3 8e e9 05 15 5c 16 bf 18 5a 83
07
        Key material offset:    136
        AF stripes:             4000
Key Slot 2: DISABLED
Key Slot 3: DISABLED
Key Slot 4: DISABLED
Key Slot 5: DISABLED
Key Slot 6: DISABLED
Key Slot 7: DISABLED


Doing an strace of cryptsetup luksOpen:
open("/proc/misc", O_RDONLY)            = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2aea59b33000
read(3, " 61 autofs\n200 tun\n220 mptctl\n 6"..., 4096) = 86
close(3)                                = 0
munmap(0x2aea59b33000, 4096)            = 0
stat("/dev/mapper/control", {st_mode=S_IFCHR|0600, st_rdev=makedev(10, 62),
...}) = 0
open("/dev/mapper/control", O_RDWR)     = 3
ioctl(3, DM_DEV_REMOVE, 0x6ecdd70)      = 0
close(3)                                = 0
stat("/dev/mapper/temporary-cryptsetup-29295", {st_mode=S_IFBLK|0660,
st_rdev=makedev(253, 0), ...}) = 0
unlink("/dev/mapper/temporary-cryptsetup-29295") = 0

And it hangs there forever, using a whole core for something (that I have
been unable to find yet). Same for AddKey.

This is on Centos 5.4 64 bit, cryptsetup-luks-1.0.3-5.el5 (and no custom
packages; all from the original repository).

Sadly, I dont have backups of the luks header that I can restore. Any ideas
on how to open the device? I am certain both keys are valid (the one in slot
1 is a file I used for scripted mounts of the device and the one in slot 0
is a passphrase that I already tried copy-pasting to avoid any typos and
keymap issues).

--
Pedro Macedo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.saout.de/pipermail/dm-crypt/attachments/20100418/f516216f/attachment.html>


More information about the dm-crypt mailing list