From: Daniil Lunev <dlunev@chromium.org>
To: Israel Rukshin <israelr@nvidia.com>, Eric Biggers <ebiggers@kernel.org>
Cc: Linux-block <linux-block@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
Nitzan Carmi <nitzanc@nvidia.com>,
Max Gurtovoy <mgurtovoy@nvidia.com>,
dm-devel@redhat.com, linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH 1/1] block: Add support for setting inline encryption key per block device
Date: Tue, 26 Jul 2022 12:40:14 +1000 [thread overview]
Message-ID: <Yt9UDoKbidXaTmYd@google.com> (raw)
In-Reply-To: <Ytj249InQTKdFshA@sol.localdomain>
On Wed, Jul 20, 2022 at 11:49:07PM -0700, Eric Biggers wrote:
> I'm glad to see a proposal in this area -- this is something that is greatly
> needed. Chrome OS is looking for something like "dm-crypt with inline crypto
> support", which this should work for. Android is also looking for something
> similar with the additional property that filesystems can override the key used.
Yes, this is exciting to see proposals in this area. In ChromeOS we were
contemplating ways to upstream Eric's work for Android. This solution should
work generally for our use-case, however I would like to add a few extra pieces
we were considering.
One thing we were looking for is having an option to pass inline encryption keys
via keyrings, similarly to how dm-crypt allows suuplying keys both ways: raw and
keyring attached. I would assume that is something that should still be possible
with the IOCTL-based approach, though proposed API can make it a bit obscure. I
was wondering whether there should be a separate field to allow this kind of
differentiation?
The other aspect is the key lifetime. Current implementation doesn't allow to
unset the key once set. This is something that would still work with dm setups,
presumably, since the key lifetime is tied to the lifetime of the device itself,
but may render problematic if this is applied to a raw device or partition of a
raw device, I would assume - allowing no ways to rotate the key without reboot.
I am not sure if this is a particularly important issue, but something that I
wanted to raise for the discussion. This also becomes relevant in the context of
the keyring usages, i.e. whether to revoke the key from the block device when
the key is removed from the keyring, or assume it is bound at the time of device
setup. The dm-crypt follows the latter model, AFAIU, and it is fine to keep it
consistent, but then the question comes back to inability to remove the key in
the current API in general.
And speaking about dm, the other thing we were looking into is compatibility of
inline encryption key setup with dm stacks. Current kernel implementaiton
propagates the crypto context through linear and flakey target, we also had
initial tests enabling it on thin pools by adding DM_TARGET_PASSES_CRYPTO, which
didn't show any problems at first glance (but more testing is required). We
believe that an ability to setup multiple different dm targets with different
keys over the same physical device is an important use case - and as far as I
can tell proposed approach supports it, but wanted to highlight that as well.
--Daniil
next prev parent reply other threads:[~2022-07-26 2:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 11:26 [PATCH 0/1 RFC] block: Add ioctl for setting default inline crypto key Israel Rukshin
2022-07-20 11:26 ` [PATCH 1/1] block: Add support for setting inline encryption key per block device Israel Rukshin
2022-07-21 6:49 ` Eric Biggers
2022-07-21 12:54 ` Christoph Hellwig
2022-07-22 8:20 ` [dm-devel] " Milan Broz
2022-07-26 2:40 ` Daniil Lunev [this message]
2022-07-21 12:51 ` Christoph Hellwig
2022-07-26 0:42 ` Eric Biggers
2022-07-28 16:26 ` Israel Rukshin
2022-07-21 12:44 ` [PATCH 0/1 RFC] block: Add ioctl for setting default inline crypto key Christoph Hellwig
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=Yt9UDoKbidXaTmYd@google.com \
--to=dlunev@chromium.org \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=ebiggers@kernel.org \
--cc=hch@lst.de \
--cc=israelr@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=mgurtovoy@nvidia.com \
--cc=nitzanc@nvidia.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).