cryptsetup.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: John Smith <dingrite@gmail.com>
To: Milan Broz <gmazyland@gmail.com>, cryptsetup@lists.linux.dev
Subject: Re: Are the keys of mounted encrypted disks secured during reboot?
Date: Mon, 26 Dec 2022 20:10:38 +0000	[thread overview]
Message-ID: <CA+5JoNp5PF+43AqbYHnjern792b=LYJtAEheFynEU8mRmw0Vxw@mail.gmail.com> (raw)
In-Reply-To: <611ca3db-6278-6e3b-5df7-0739e47cbfaa@gmail.com>

I'm asking about when a regular shutdown/reboot/suspend-to-disk is
issued. In most cases the rootfs volume is not unmounted because that
would require a pivot_root to a special initrd/ramdisk-rootfs just for
powering off.
So that would mean the device isn't deactivated via cryptsetup -
because that would fail.
In that case, when the kernel is preparing to reboot/poweroff, will it
wipe the keys or just leave them there vulnerable to cold boot or
forensics?

On Mon, Dec 26, 2022 at 7:42 PM Milan Broz <gmazyland@gmail.com> wrote:
>
> On 12/26/22 20:13, John Smith wrote:
> > During the course of proper shutdown/reboot/suspend-to-disk, does the
> > kernel securely erase (or at least free memory of - as it pertains to
> > init_on_free=1) encryption keys of all dmcrypt/luks systems which
> > remained mounted?
>
> If the device is properly deactivated, then keys are always wiped.
>
> (Actually, with LUKS2, dm-crypt no longer keeps own copy of the key, it
> is stored in kernel keyring only for activation and then, obviously, in kernel
> crypto where is is directly used for encryption. So if it is not
> deactivated, it is responsibility of these subsystems to wipe it on reboot.)
>
> For suspend to ram, it is more complicated - there is a way how to wipe key
> and freeze device temporarily (see luksSuspend), but I do no think many systems
> actually use it. Debian has cryptsetup-suspend that can do this AFAIK.
>
> For suspend to disk, the memory should be written to encrypted device.
> (And RAM contents disappears after some short time with no power anyway.)
>
> Milan

  reply	other threads:[~2022-12-26 20:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-26 19:13 Are the keys of mounted encrypted disks secured during reboot? John Smith
2022-12-26 19:42 ` Milan Broz
2022-12-26 20:10   ` John Smith [this message]
2022-12-28  8:51     ` 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='CA+5JoNp5PF+43AqbYHnjern792b=LYJtAEheFynEU8mRmw0Vxw@mail.gmail.com' \
    --to=dingrite@gmail.com \
    --cc=cryptsetup@lists.linux.dev \
    --cc=gmazyland@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).