[dm-crypt] Offset/size issue during LUKS recovery.

Julio Cesar Faracco jfaracco at br.ibm.com
Fri Jul 15 02:52:35 CEST 2016


Hi,

Since I moved to the version 1.6.7 of cryptsetup, I started to have some problems to recovery a LUKS partition
using a LUKS header file and a valid passphrase.

I'm following the steps bellow:

# losetup /dev/loop0 my_header_file
# cryptsetup luksOpen /dev/loop0 my_enc_partition <<EOF
$(PASSWORD)
EOF

I'm getting the following output/error:
Key slot 6 unlocked.
Requested offset is beyond real size of device /dev/loop0.

I was checking the code and at this point cryptsetup compares the device size with the Header offset, right?
After, that I used luksDump to check the offset and I add --debug to all commands...

# cryptsetup luksDump my_header_file --debug
# Detected kernel Linux 3.10.0-327.13.1.el7.x86_64 x86_64.
# Reading LUKS header of size 1024 from device /tmp/my_header_file
# Key length 64, device size 8192 sectors, header size 4036 sectors.
LUKS header information for /tmp/my_header_file
Version:           1
Cipher name:       aes
Cipher mode:       xts-plain64
Hash spec:         sha1
Payload offset:    4096
MK bits:           512
...

And,

When I run luksOpen, I got:

# # cryptsetup luksOpen /dev/loop0 my_enc_partition <<EOF
$(PASSWORD)
EOF
# Detected kernel Linux 3.10.0-327.13.1.el7.x86_64 x86_64.
# Reading LUKS header of size 1024 from device /tmp/my_header_file
# Key length 64, device size 4060 sectors, header size 4036 sectors.
# Iteration time set to 2000 miliseconds.
# STDIN descriptor passphrase entry requested.
...
Key slot 6 unlocked.
Requested offset is beyond real size of device /dev/loop0.

Two doubts:
- Is it right? Why does one command say that LUKS header has 8192 sectors and the other command say that it has 4060?
- And about the Payload Offset? Payload offset is lower than 8192 but it is higher that 4060. This is causing my issue.

Any help for the problem would be amazing.

 Regards,
 
 Julio Cesar Faracco



More information about the dm-crypt mailing list