dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Coiby Xu <coxu@redhat.com>
Cc: Baoquan He <bhe@redhat.com>, Kairui Song <ryncsn@gmail.com>,
	x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, Pingfan Liu <kernelfans@gmail.com>,
	Eric Biggers <ebiggers@kernel.org>,
	Dave Hansen <dave.hansen@intel.com>,
	dm-devel@redhat.com, Jan Pazdziora <jpazdziora@redhat.com>,
	Thomas Staudt <tstaudt@de.ibm.com>,
	Ondrej Kozina <okozina@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Dave Young <dyoung@redhat.com>
Subject: Re: [dm-devel] [PATCH 0/5] Support kdump with LUKS encryption by reusing LUKS volume key
Date: Thu, 8 Jun 2023 12:39:26 +0200	[thread overview]
Message-ID: <f7a1a20c-bee8-c7a4-4c49-b66415f556f9@gmail.com> (raw)
In-Reply-To: <maamg4udo7visvgzp4m4qkfcds6djyiga236lb2mwtjasi6pvj@zmqzb2lijegj>

On 6/7/23 14:39, Coiby Xu wrote:
...
>> I do not think you need any cryptsetup patches, all you need is to write
>> decrypted volume key from LUKS metadata with
>>   cryptsetup luksDump ---dump-volume-key -volume-key-file <out> <device>
>> (or any code equivalent with libcryptsetup), am I correct?
> 
> Correct me if I'm wrong, but I don't think there will be a safer way to
> preserve key without patching cryptsetup. Actually the --dump-volume-key
> approach has been proposed before and I agree with your conclusion [1]
> on that approach i.e. "passing volume key this way is quite insecure".
> Without patching cryptsetup, even if I save the volume key in the memory
> reserved for the kdump kernel, I need to retrieve this key in the
> userspace to unlock the LUKS device which may lead to quite a security
> vulnerability.

Hm, where are the patches for cryptsetup, then? I am afraid we do not want
to add such specific things there.

But we are just going to merge a patchset that changes how we use keyring
where you can tell cryptsetup to store/link key under some specific name
and to specific keyring
(see https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/492)
(Please talk to Red Hat cryptsetup maintainers for more info,
I just mentioned this mail to them today.)

> I respect the efforts from you and the cryptsetup community to make LUKS
> as secure as possible. And kdump is used in product environment. Kdump
> is to a server as a black box is to an aircraft. So by no means I want
> to reverse the used security measures and patching cryptsetup can allow
> to keep the security measures. One concern raised by you against "FRC
> v1" was a copy of the LUKS volume key for the kdump kernel creates an
> attack vector. I took this feedback seriously and have sought advice
> from my colleagues to implement the countermeasures ([PATCH 1/5] and
> [Patch 4/5]).
> 
> [1] https://yhbt.net/lore/all/e5abd089-3398-fdb4-7991-0019be434b79@gmail.com/

Yes, I appreciate that. And it is perfectly ok if your customers accept
the trade-off and security risk of handling the key this way.

Anyway, I feel we are going in circles here, and as it seems to be my fault,
I do not want to sound grumpy as I am perhaps missing some context.

Could you please talk to internal RH cryptsetup maintainers first and discuss
your solution? They know what we can do here can help to find an acceptable
solution. (I added cc to Ondra.)

Thanks,
Milan

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2023-06-08 10:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01  7:24 [dm-devel] [PATCH 0/5] Support kdump with LUKS encryption by reusing LUKS volume key Coiby Xu
2023-06-01  7:24 ` [dm-devel] [PATCH 1/5] kexec_file: allow to place kexec_buf randomly Coiby Xu
2023-06-01  7:24 ` [dm-devel] [PATCH 2/5] crash_dump: save the LUKS volume key temporarily Coiby Xu
2023-06-01  7:24 ` [dm-devel] [PATCH 3/5] crash_dump: retrieve LUKS volume key in kdump kernel Coiby Xu
2023-06-01  7:24 ` [dm-devel] [PATCH 4/5] x86/crash: pass the LUKS volume key to " Coiby Xu
2023-06-01  7:24 ` [dm-devel] [PATCH 5/5] x86/crash: make the page that stores the LUKS volume key inaccessible Coiby Xu
2023-06-02 21:34 ` [dm-devel] [PATCH 0/5] Support kdump with LUKS encryption by reusing LUKS volume key Eric Biggers
2023-06-03  9:22   ` Milan Broz
2023-06-05  2:31     ` Coiby Xu
2023-06-05  7:09       ` Milan Broz
2023-06-06 11:02         ` Coiby Xu
2023-06-07  6:14           ` Milan Broz
2023-06-07 12:39             ` Coiby Xu
2023-06-08 10:39               ` Milan Broz [this message]
2023-06-09  9:58                 ` Coiby Xu

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=f7a1a20c-bee8-c7a4-4c49-b66415f556f9@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=bhe@redhat.com \
    --cc=coxu@redhat.com \
    --cc=dave.hansen@intel.com \
    --cc=dm-devel@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=jpazdziora@redhat.com \
    --cc=kernelfans@gmail.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okozina@redhat.com \
    --cc=ryncsn@gmail.com \
    --cc=tstaudt@de.ibm.com \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    /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).