All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: mika.kujanpaa@nic.fi
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] LUKS keyslot 4 is invalid.
Date: Sun, 27 Nov 2011 12:33:08 +0100	[thread overview]
Message-ID: <4ED21FF4.5020200@redhat.com> (raw)
In-Reply-To: <4ED133B7.2030806@redhat.com>

On 11/26/2011 07:45 PM, Milan Broz wrote:
> On 11/26/2011 03:19 PM, Mika Kujanpää wrote:
>> I've tried to find information, if there is some possibility to recover access to disk. When I try luksOpen or luksDump, i get
>>
>> cryptsetup luksDump /dev/disk/by-uuid/7fa45e9b-6b3d-4ac7-becc-7b8fe5d463a3
>> LUKS keyslot 4 is invalid.
>> LUKS keyslot 5 is invalid.

Perhaps another item to FAQ:

In cryptsetup 1.4.x I added check of keyslot data offset.
(Keyslot offset is calculated during format for all slots
including inactive slots.)

If any keyslot offset points to the area outside of LUKS header,
header is corrupted (IOW keylot point to the payload data area
and in theory can overwrite user data when activated.)

And exactly this happened there, inactive slot 4 and 5 had
wrong offset. Because there was know signature 0x55 0xAA in last
bytes of the first sector I guess some "clever" partition tool
wrote few bytes there after LUKS was formatted.

if you run luksDump --debug here, you will see better error
message, here e.g.

# Reading LUKS header of size 1024 from device /dev/sdb
# Invalid offset 1760061416 in keyslot 4 (beyond data area offset 4096).
LUKS keyslot 4 is invalid.


How to fix that depends on situation...

If you have old cryptsetup, you can activate device and reformat
the header using "How do I recover the master key
from a mapped LUKS container?" in FAQ.

With exact knowledge of LUKS header you can fix that manually.
(I used simple dd from another device in this case but offset depends
on situation.)

Milan

  reply	other threads:[~2011-11-27 11:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-26 14:19 [dm-crypt] LUKS keyslot 4 is invalid Mika Kujanpää
2011-11-26 18:45 ` Milan Broz
2011-11-27 11:33   ` Milan Broz [this message]
2011-11-27 12:30     ` Arno Wagner
  -- strict thread matches above, loose matches on Subject: below --
2014-11-19 22:52 Jarosław K
2014-11-20 19:04 ` Arno Wagner
2014-11-25 21:50 ` Jarosław K
2014-11-25 23:15   ` Arno Wagner
2014-11-26 17:11   ` Jarosław K
2014-11-26 17:54     ` Arno Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED21FF4.5020200@redhat.com \
    --to=mbroz@redhat.com \
    --cc=dm-crypt@saout.de \
    --cc=mika.kujanpaa@nic.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.