From: Eric Biggers <ebiggers@kernel.org>
To: Satya Tangirala <satyat@google.com>
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-ext4@vger.kernel.org,
Barani Muthukumaran <bmuthuku@qti.qualcomm.com>,
Kuohong Wang <kuohong.wang@mediatek.com>,
Kim Boojin <boojin.kim@samsung.com>
Subject: Re: [PATCH v12 02/12] block: Keyslot Manager for Inline Encryption
Date: Wed, 13 May 2020 09:59:28 -0700 [thread overview]
Message-ID: <20200513165928.GB1243@sol.localdomain> (raw)
In-Reply-To: <20200430115959.238073-3-satyat@google.com>
On Thu, Apr 30, 2020 at 11:59:49AM +0000, Satya Tangirala wrote:
> Inline Encryption hardware allows software to specify an encryption context
> (an encryption key, crypto algorithm, data unit num, data unit size) along
> with a data transfer request to a storage device, and the inline encryption
> hardware will use that context to en/decrypt the data. The inline
> encryption hardware is part of the storage device, and it conceptually sits
> on the data path between system memory and the storage device.
>
> Inline Encryption hardware implementations often function around the
> concept of "keyslots". These implementations often have a limited number
> of "keyslots", each of which can hold a key (we say that a key can be
> "programmed" into a keyslot). Requests made to the storage device may have
> a keyslot and a data unit number associated with them, and the inline
> encryption hardware will en/decrypt the data in the requests using the key
> programmed into that associated keyslot and the data unit number specified
> with the request.
>
> As keyslots are limited, and programming keys may be expensive in many
> implementations, and multiple requests may use exactly the same encryption
> contexts, we introduce a Keyslot Manager to efficiently manage keyslots.
>
> We also introduce a blk_crypto_key, which will represent the key that's
> programmed into keyslots managed by keyslot managers. The keyslot manager
> also functions as the interface that upper layers will use to program keys
> into inline encryption hardware. For more information on the Keyslot
> Manager, refer to documentation found in block/keyslot-manager.c and
> linux/keyslot-manager.h.
>
> Co-developed-by: Eric Biggers <ebiggers@google.com>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> Signed-off-by: Satya Tangirala <satyat@google.com>
Looks good. This already has my Co-developed-by, but if needed you can also add
Reviewed-by: Eric Biggers <ebiggers@google.com>
A couple comments below for when you resend:
> +++ b/block/keyslot-manager.c
> @@ -0,0 +1,378 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright 2019 Google LLC
> + */
> +
> +/**
> + * DOC: The Keyslot Manager
> + *
> + * Many devices with inline encryption support have a limited number of "slots"
> + * into which encryption contexts may be programmed, and requests can be tagged
> + * with a slot number to specify the key to use for en/decryption.
> + *
> + * As the number of slots are limited, and programming keys is expensive on
"are limited" => "is limited".
> +/**
> + * struct blk_crypto_key - an inline encryption key
> + * @crypto_cfg: the crypto configuration (like crypto_mode, key size) for this
> + * key
> + * @data_unit_size_bits: log2 of data_unit_size
> + * @size: size of this key in bytes (determined by @crypto_cfg.crypto_mode)
> + * @raw: the raw bytes of this key. Only the first @size bytes are used.
> + *
> + * A blk_crypto_key is immutable once created, and many bios can reference it at
> + * the same time. It must not be freed until all bios using it have completed.
> + */
Since eviction is now mandatory, the last sentence should be something like:
"It must not be freed until all bios using it have completed and it has been
evicted from all devices on which it may have been used."
- Eric
next prev parent reply other threads:[~2020-05-13 16:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 11:59 [PATCH v12 00/12] Inline Encryption Support Satya Tangirala
2020-04-30 11:59 ` [PATCH v12 01/12] Documentation: Document the blk-crypto framework Satya Tangirala
2020-05-13 16:47 ` Eric Biggers
2020-04-30 11:59 ` [PATCH v12 02/12] block: Keyslot Manager for Inline Encryption Satya Tangirala
2020-05-13 13:35 ` Christoph Hellwig
2020-05-13 16:59 ` Eric Biggers [this message]
2020-04-30 11:59 ` [PATCH v12 03/12] block: Inline encryption support for blk-mq Satya Tangirala
2020-05-13 13:36 ` Christoph Hellwig
2020-05-13 17:27 ` Eric Biggers
2020-04-30 11:59 ` [PATCH v12 04/12] block: Make blk-integrity preclude hardware inline encryption Satya Tangirala
2020-05-13 13:37 ` Christoph Hellwig
2020-05-13 17:30 ` Eric Biggers
2020-04-30 11:59 ` [PATCH v12 05/12] block: blk-crypto-fallback for Inline Encryption Satya Tangirala
2020-05-13 18:05 ` Eric Biggers
2020-04-30 11:59 ` [PATCH v12 06/12] scsi: ufs: UFS driver v2.1 spec crypto additions Satya Tangirala
2020-05-13 18:16 ` Eric Biggers
2020-04-30 11:59 ` [PATCH v12 07/12] scsi: ufs: UFS crypto API Satya Tangirala
2020-05-13 18:16 ` Eric Biggers
2020-04-30 11:59 ` [PATCH v12 08/12] scsi: ufs: Add inline encryption support to UFS Satya Tangirala
2020-05-13 18:19 ` Eric Biggers
2020-04-30 11:59 ` [PATCH v12 09/12] fs: introduce SB_INLINECRYPT Satya Tangirala
2020-04-30 11:59 ` [PATCH v12 10/12] fscrypt: add inline encryption support Satya Tangirala
2020-04-30 17:04 ` Eric Biggers
2020-04-30 11:59 ` [PATCH v12 11/12] f2fs: " Satya Tangirala
2020-04-30 11:59 ` [PATCH v12 12/12] ext4: " Satya Tangirala
2020-04-30 17:02 ` [PATCH v12 00/12] Inline Encryption Support Eric Biggers
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=20200513165928.GB1243@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=bmuthuku@qti.qualcomm.com \
--cc=boojin.kim@samsung.com \
--cc=kuohong.wang@mediatek.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=satyat@google.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).