linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 01/12] Documentation: Document the blk-crypto framework
Date: Wed, 13 May 2020 09:47:07 -0700	[thread overview]
Message-ID: <20200513164707.GA1243@sol.localdomain> (raw)
In-Reply-To: <20200430115959.238073-2-satyat@google.com>

On Thu, Apr 30, 2020 at 11:59:48AM +0000, Satya Tangirala wrote:
> The blk-crypto framework adds support for inline encryption. There
> are numerous changes throughout the storage stack. This patch documents
> the main design choices in the block layer, the API presented to users
> of the block layer (like fscrypt or layered devices) and the API presented
> to drivers for adding support for inline encryption.
> 
> Signed-off-by: Satya Tangirala <satyat@google.com>

Looks good, you can add:

    Reviewed-by: Eric Biggers <ebiggers@google.com>

But a few comments for when you resend:

> +When a bio is added to a request, the request takes over ownership of the
> +``bi_crypt_context`` of the bio - in particular, the request keeps the
> +``bi_crypt_context`` of the first bio in its bio-list, and frees the rest
> +(blk-mq needs to be careful to maintain this invariant during bio and request
> +merges).

Is this part up-to-date?  There was discussion about not freeing the bios' crypt
contexts.

> +``blk_crypto_evict_key`` should be called by upper layers when they want
> +to ensure that a key is removed from memory and from any keyslots in inline
> +encryption hardware that the key might have been programmed into (or the
> +blk-crypto-fallback).

This should be reworded to emphasize that blk_crypto_evict_key()
*must* be called (as now the keyslot manager has a pointer to the key).

> +API presented to device drivers
> +===============================
> +
> +A :c:type:``struct keyslot_manager`` should be set up by device drivers in the

"keyslot_manager" => "blk_keyslot_manager".  Likewise below.

> +``request_queue`` of the device. The device driver needs to call
> +``blk_ksm_init`` on the ``keyslot_manager``, which specfying the number of
> +keyslots supported by the hardware.

"which specfying" => "while specifying"

> +The device driver also needs to tell the KSM how to actually manipulate the
> +IE hardware in the device to do things like programming the crypto key into
> +the IE hardware into a particular keyslot. All this is achieved through the
> +:c:type:`struct keyslot_mgmt_ll_ops` field in the KSM that the device driver
> +must fill up after initing the ``keyslot_manager``.

"keyslot_mgmt_ll_ops" => "blk_ksm_ll_ops"

- Eric

  reply	other threads:[~2020-05-13 16:47 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 [this message]
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
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=20200513164707.GA1243@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).