DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arno Wagner <arno@wagner.name>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] Dmcrypt and hibernate key disclosure
Date: Fri, 7 Jan 2011 03:49:11 +0100	[thread overview]
Message-ID: <20110107024910.GA2456@tansi.org> (raw)
In-Reply-To: <4D266EF9.6090904@gmail.com>

On Fri, Jan 07, 2011 at 09:40:09AM +0800, Aaron Lewis wrote:
> Hi,
> 	If i hibernate with an device opened , before i resume , an image was
> written on swap partition , will there be a problem with my secret key's
> disclosure ?
> 
> 	Just an off-line attack , if swap is not encrypted.
> 
> 	And is there any suggestion for this special operation ? Because my
> root partition is also encrypted , so i can't simply close that device
> before hibernation took place.
> 
> 	Thanks.

Did a Google search and ended up at something I said here some
time ago that did not really help ;-)

First, I do not know for sure how hibernation works. I never 
used it. What I could find out, is that hobernation does
shut down the computer and boots it up into an image of
the pre-hibernation state instead of going through the 
normal boot sequence.

As fas as I can tell, all suspend methods do store all 
used memory pages to swap, and that definitely includes 
the kernel pages with the disk encryption keys.

Now, with uncencrypted swap, that clearly exposes the keys.
There seems to be an option to encrypt swap with a temporary 
key that gets wiped after resume. This way the encryption keys
would be exposed during hibernation, but not after wakeup.
It seems that with the swsup hibernation method that may
be default behaviour. Some explanation here:

http://www.freesoftwaremagazine.com/articles/hibernate_linux


The other option would be to modify the resume process to
ask you for the passphrase to the swap partition. I don't 
know whether that is possible. It seems to me that there
is actually no software hook or script thet gets executed
during resume, but that it is a full kernel-internal
operation. I also see no reference to a possibility to pass
swap encryption keys to the kernel. In this case, there is 
no way around the exposure during hibernate.


I see a possible alternate way to do this. Use a virtualized
environment for your system and suspend that to a device 
encrypted by the base system. Then you can hibernate the 
virtualized system, do a normal shutdown and reboot of the 
base system, configure the encrypted filesystem and unsuspend 
the virtual machine from it. I do that with a virtual
machine for working on confidential data. More effort, but 
suspend to disk (=hibernation) and security do not really mix.

Arno
-- 
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 

  reply	other threads:[~2011-01-07  2:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  1:40 [dm-crypt] Dmcrypt and hibernate key disclosure Aaron Lewis
2011-01-07  2:49 ` Arno Wagner [this message]
2011-01-07  4:08   ` Bryan Kadzban
2011-01-07  4:39     ` Arno Wagner
2011-01-08  4:45       ` Bryan Kadzban
2011-01-08 11:53         ` Heiko Rosemann
2011-01-08 14:55         ` iggy
2011-01-07 10:42     ` Heiko Rosemann
2011-01-11  0:08 ` Richard
2011-01-11  9:11   ` Arno Wagner
2011-01-11 10:31     ` Milan Broz
2011-01-11 16:35       ` Richard
2011-01-11 17:08         ` Milan Broz

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=20110107024910.GA2456@tansi.org \
    --to=arno@wagner.name \
    --cc=dm-crypt@saout.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox