Re: [f2fs-dev] [PATCH v12 08/12] scsi: ufs: Add inline encryption support to UFS

2020-05-13 Thread Eric Biggers
On Thu, Apr 30, 2020 at 11:59:55AM +, Satya Tangirala wrote: > @@ -8541,6 +8568,13 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem > *mmio_base, unsigned int irq) > /* Reset the attached device */ > ufshcd_vops_device_reset(hba); > > + /* Init crypto */ > + err =

Re: [f2fs-dev] [PATCH v12 02/12] block: Keyslot Manager for Inline Encryption

2020-05-13 Thread Eric Biggers
On Thu, Apr 30, 2020 at 11:59:49AM +, 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

Re: [f2fs-dev] [PATCH v12 03/12] block: Inline encryption support for blk-mq

2020-05-13 Thread Eric Biggers
On Thu, Apr 30, 2020 at 11:59:50AM +, Satya Tangirala wrote: > We must have some way of letting a storage device driver know what > encryption context it should use for en/decrypting a request. However, > it's the upper layers (like the filesystem/fscrypt) that know about and > manages

Re: [f2fs-dev] [PATCH v12 05/12] block: blk-crypto-fallback for Inline Encryption

2020-05-13 Thread Eric Biggers
On Thu, Apr 30, 2020 at 11:59:52AM +, Satya Tangirala wrote: > Blk-crypto delegates crypto operations to inline encryption hardware when > available. The separately configurable blk-crypto-fallback contains a > software fallback to the kernel crypto API - when enabled, blk-crypto > will use

Re: [f2fs-dev] [PATCH v12 01/12] Documentation: Document the blk-crypto framework

2020-05-13 Thread Eric Biggers
On Thu, Apr 30, 2020 at 11:59:48AM +, 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

Re: [f2fs-dev] [PATCH v12 06/12] scsi: ufs: UFS driver v2.1 spec crypto additions

2020-05-13 Thread Eric Biggers
On Thu, Apr 30, 2020 at 11:59:53AM +, Satya Tangirala wrote: > Add the crypto registers and structs defined in v2.1 of the JEDEC UFSHCI > specification in preparation to add support for inline encryption to > UFS. > > Signed-off-by: Satya Tangirala Looks good, you can add: Reviewed-by:

Re: [f2fs-dev] [PATCH v12 07/12] scsi: ufs: UFS crypto API

2020-05-13 Thread Eric Biggers
On Thu, Apr 30, 2020 at 11:59:54AM +, Satya Tangirala wrote: > Introduce functions to manipulate UFS inline encryption hardware > in line with the JEDEC UFSHCI v2.1 specification and to work with the > block keyslot manager. > > The UFS crypto API will assume by default that a vendor driver

Re: [f2fs-dev] [PATCH v12 04/12] block: Make blk-integrity preclude hardware inline encryption

2020-05-13 Thread Eric Biggers
On Thu, Apr 30, 2020 at 11:59:51AM +, Satya Tangirala wrote: > Whenever a device supports blk-integrity, make the kernel pretend that > the device doesn't support inline encryption (essentially by setting the > keyslot manager in the request queue to NULL). > > There's no hardware currently

[f2fs-dev] [PATCH v13 10/12] fscrypt: add inline encryption support

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
Add support for inline encryption to fs/crypto/. With "inline encryption", the block layer handles the decryption/encryption as part of the bio, instead of the filesystem doing the crypto itself via Linux's crypto API. This model is needed in order to take advantage of the inline encryption

[f2fs-dev] [PATCH v13 07/12] scsi: ufs: UFS crypto API

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
Introduce functions to manipulate UFS inline encryption hardware in line with the JEDEC UFSHCI v2.1 specification and to work with the block keyslot manager. The UFS crypto API will assume by default that a vendor driver doesn't support UFS crypto, even if the hardware advertises the capability,

[f2fs-dev] [PATCH v13 05/12] block: blk-crypto-fallback for Inline Encryption

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
Blk-crypto delegates crypto operations to inline encryption hardware when available. The separately configurable blk-crypto-fallback contains a software fallback to the kernel crypto API - when enabled, blk-crypto will use this fallback for en/decryption when inline encryption hardware is not

[f2fs-dev] [PATCH v13 00/12] Inline Encryption Support

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
This patch series adds support for Inline Encryption to the block layer, UFS, fscrypt, f2fs and ext4. It has been rebased onto linux-block/for-next. Note that the patches in this series for the block layer (i.e. patches 1, 2, 3, 4 and 5) can be applied independently of the subsequent patches in

[f2fs-dev] [PATCH v13 12/12] ext4: add inline encryption support

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
From: Eric Biggers Wire up ext4 to support inline encryption via the helper functions which fs/crypto/ now provides. This includes: - Adding a mount option 'inlinecrypt' which enables inline encryption on encrypted files where it can be used. - Setting the bio_crypt_ctx on bios that will be

[f2fs-dev] [PATCH v13 09/12] fs: introduce SB_INLINECRYPT

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
Introduce SB_INLINECRYPT, which is set by filesystems that wish to use blk-crypto for file content en/decryption. This flag maps to the '-o inlinecrypt' mount option which multiple filesystems will implement, and code in fs/crypto/ needs to be able to check for this mount option in a

[f2fs-dev] [PATCH v13 04/12] block: Make blk-integrity preclude hardware inline encryption

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
Whenever a device supports blk-integrity, make the kernel pretend that the device doesn't support inline encryption (essentially by setting the keyslot manager in the request queue to NULL). There's no hardware currently that supports both integrity and inline encryption. However, it seems

[f2fs-dev] [PATCH v13 06/12] scsi: ufs: UFS driver v2.1 spec crypto additions

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
Add the crypto registers and structs defined in v2.1 of the JEDEC UFSHCI specification in preparation to add support for inline encryption to UFS. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers --- drivers/scsi/ufs/ufshcd.c | 2 ++ drivers/scsi/ufs/ufshcd.h | 6

[f2fs-dev] [PATCH v13 03/12] block: Inline encryption support for blk-mq

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
We must have some way of letting a storage device driver know what encryption context it should use for en/decrypting a request. However, it's the upper layers (like the filesystem/fscrypt) that know about and manages encryption contexts. As such, when the upper layer submits a bio to the block

[f2fs-dev] [PATCH v13 08/12] scsi: ufs: Add inline encryption support to UFS

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
Wire up ufshcd.c with the UFS Crypto API, the block layer inline encryption additions and the keyslot manager. Signed-off-by: Satya Tangirala --- drivers/scsi/ufs/ufshcd-crypto.h | 18 + drivers/scsi/ufs/ufshcd.c| 44

[f2fs-dev] [PATCH v13 02/12] block: Keyslot Manager for Inline Encryption

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
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

[f2fs-dev] [PATCH v13 01/12] Documentation: Document the blk-crypto framework

2020-05-13 Thread Satya Tangirala via Linux-f2fs-devel
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

Re: [f2fs-dev] [PATCH v13 08/12] scsi: ufs: Add inline encryption support to UFS

2020-05-13 Thread Eric Biggers
On Thu, May 14, 2020 at 12:37:23AM +, Satya Tangirala wrote: > Wire up ufshcd.c with the UFS Crypto API, the block layer inline > encryption additions and the keyslot manager. > > Signed-off-by: Satya Tangirala Looks good, you can add: Reviewed-by: Eric Biggers - Eric

Re: [f2fs-dev] [PATCH v13 00/12] Inline Encryption Support

2020-05-13 Thread Eric Biggers
On Thu, May 14, 2020 at 12:37:15AM +, Satya Tangirala wrote: > This patch series adds support for Inline Encryption to the block layer, > UFS, fscrypt, f2fs and ext4. It has been rebased onto linux-block/for-next. > > Note that the patches in this series for the block layer (i.e. patches 1, >

Re: [f2fs-dev] [PATCH v12 04/12] block: Make blk-integrity preclude hardware inline encryption

2020-05-13 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v12 03/12] block: Inline encryption support for blk-mq

2020-05-13 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig although this will need a rebase to the latest block tree. ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Re: [f2fs-dev] [PATCH v12 02/12] block: Keyslot Manager for Inline Encryption

2020-05-13 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel