[PATCH v2 2/4] crypto: qat - validate xts key

2020-06-26 Thread Giovanni Cabiddu
Validate xts key using the function xts_verify_key() to prevent malformed keys. Signed-off-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/qat_algs.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/qat/qat_common/qat_algs.c b/drivers/crypto/qat/qat_common/qat_alg

[PATCH v2 3/4] crypto: qat - remove unused field in skcipher ctx

2020-06-26 Thread Giovanni Cabiddu
Remove tfm field in qat_alg_skcipher_ctx structure. This is not used. Signed-off-by: Giovanni Cabiddu --- drivers/crypto/qat/qat_common/qat_algs.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/crypto/qat/qat_common/qat_algs.c b/drivers/crypto/qat/qat_common/qat_algs.c index 11f

[PATCH v2 1/4] crypto: qat - allow xts requests not multiple of block

2020-06-26 Thread Giovanni Cabiddu
Allow aes xts requests that are not multiple of the block size. If a request is smaller than the block size, return -EINVAL. This fixes the following issue reported by the crypto testmgr self-test: alg: skcipher: qat_aes_xts encryption failed on test vector "random: len=116 klen=64"; expected_erro

[PATCH v2 0/4] crypto: qat - fixes to aes xts

2020-06-26 Thread Giovanni Cabiddu
This series fixes a few issues with the xts(aes) implementation in the QuickAssist driver: - Requests that are not multiple of the block size are rejected - Input key not validated - xts(aes) requests with key size 192 bits are rejected with -EINVAL Changes from v1: - Removed extra pair of par

[PATCH v2 4/4] crypto: qat - fallback for xts with 192 bit keys

2020-06-26 Thread Giovanni Cabiddu
Forward requests to another provider if the key length is 192 bits as this is not supported by the QAT accelerators. This fixes the following issue reported by the extra self test: alg: skcipher: qat_aes_xts setkey failed on test vector "random: len=3204 klen=48"; expected_error=0, actual_error=-2

Re: [PATCHv4 3/7] crypto: sa2ul: add sha1/sha256/sha512 support

2020-06-26 Thread Tero Kristo
On 26/06/2020 07:31, Herbert Xu wrote: On Mon, Jun 15, 2020 at 10:14:48AM +0300, Tero Kristo wrote: +static int sa_sha_update(struct ahash_request *req) +{ + struct sa_sha_req_ctx *rctx = ahash_request_ctx(req); + struct scatterlist *sg; + void *buf; + int pages; +

[PATCH 1/5] crypto: hisilicon/sec2 - clear SEC debug regs

2020-06-26 Thread Longfang Liu
From: Kai Ye SEC debug registers aren't cleared even if its driver is removed, so add a clearing operation in driver removing. Signed-off-by: Kai Ye Reviewed-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec_main.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/crypto

[PATCH 4/5] crypto: hisilicon/sec2 - update debugfs interface parameters

2020-06-26 Thread Longfang Liu
Update debugfs interface parameters, and adjust the processing logic inside the corresponding function Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec_main.c | 54 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/crypto/hi

[PATCH 2/5] crypto:hisilicon/sec2 - update busy processing logic

2020-06-26 Thread Longfang Liu
From: Kai Ye As before, if a SEC queue is at the 'fake busy' status, the request with a 'fake busy' flag will be sent into hardware and the sending function returns busy. After the request is finished, SEC driver's call back will identify the 'fake busy' flag, and notifies the user that hardware

[PATCH 0/5] crypto: hisilicon/sec2 - fix SEC bugs and coding styles

2020-06-26 Thread Longfang Liu
Fix some SEC driver bugs and modify some coding styles Kai Ye (2): crypto: hisilicon/sec2 - clear SEC debug regs crypto:hisilicon/sec2 - update busy processing logic Longfang Liu (3): crypto: hisilicon/sec2 - update SEC initialization and reset crypto: hisilicon/sec2 - update debugfs inte

[PATCH 3/5] crypto: hisilicon/sec2 - update SEC initialization and reset

2020-06-26 Thread Longfang Liu
Updates the initialization and reset of SEC driver's register operation. Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/qm.h| 1 + drivers/crypto/hisilicon/sec2/sec_main.c | 55 2 files changed, 29 insertions(+), 27 deletions(-) diff --git

[PATCH 5/5] crypto: hisilicon/sec2 - fix some coding styles

2020-06-26 Thread Longfang Liu
Modify some log output interfaces and update author information Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec_main.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main

Re: [PATCH 1/3] crypto: pass the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-26 Thread Mikulas Patocka
On Fri, 26 Jun 2020, Herbert Xu wrote: > On Wed, Jun 17, 2020 at 11:09:28AM -0400, Mikulas Patocka wrote: > > > > Index: linux-2.6/include/linux/crypto.h > > === > > --- linux-2.6.orig/include/linux/crypto.h > > +++ linux-2.6/inclu

[PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-26 Thread Mikulas Patocka
Introduce a new flag CRYPTO_ALG_ALLOCATES_MEMORY and pass it down the crypto stack. If the flag is set, then the crypto driver allocates memory in its request routine. Such drivers are not suitable for disk encryption because GFP_ATOMIC allocation can fail anytime (causing random I/O errors) and G

Re: [PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-26 Thread Eric Biggers
On Fri, Jun 26, 2020 at 12:16:33PM -0400, Mikulas Patocka wrote: > +/* > + * Pass these flags down through the crypto API. > + */ > +#define CRYPTO_ALG_INHERITED_FLAGS (CRYPTO_ALG_ASYNC | > CRYPTO_ALG_ALLOCATES_MEMORY) This comment is useless. How about: /* * When an algorithm uses another a

Re: [dm-devel] [PATCH 1/3 v2] crypto: introduce the flag CRYPTO_ALG_ALLOCATES_MEMORY

2020-06-26 Thread Eric Biggers
On Fri, Jun 26, 2020 at 09:46:17AM -0700, Eric Biggers wrote: > On Fri, Jun 26, 2020 at 12:16:33PM -0400, Mikulas Patocka wrote: > > +/* > > + * Pass these flags down through the crypto API. > > + */ > > +#define CRYPTO_ALG_INHERITED_FLAGS (CRYPTO_ALG_ASYNC | > > CRYPTO_ALG_ALLOCATES_MEMORY) > >

Re: [PATCH v2 4/4] crypto: qat - fallback for xts with 192 bit keys

2020-06-26 Thread Ard Biesheuvel
On Fri, 26 Jun 2020 at 10:04, Giovanni Cabiddu wrote: > > Forward requests to another provider if the key length is 192 bits as > this is not supported by the QAT accelerators. > > This fixes the following issue reported by the extra self test: > alg: skcipher: qat_aes_xts setkey failed on test ve

[PATCH] crypto: ccp - Update CCP driver maintainer information

2020-06-26 Thread Tom Lendacky
From: Tom Lendacky Add John Allen as a new CCP driver maintainer. Additionally, break out the driver SEV support and create a new maintainer entry, with Brijesh Singh and Tom Lendacky as maintainers. Cc: John Allen Cc: Brijesh Singh Signed-off-by: Tom Lendacky --- MAINTAINERS | 9 +

Re: [PATCH] crypto: ccp - Update CCP driver maintainer information

2020-06-26 Thread Brijesh Singh
On 6/26/20 2:00 PM, Tom Lendacky wrote: > From: Tom Lendacky > > Add John Allen as a new CCP driver maintainer. Additionally, break out > the driver SEV support and create a new maintainer entry, with Brijesh > Singh and Tom Lendacky as maintainers. > > Cc: John Allen > Cc: Brijesh Singh > Sig

[PATCH v2] crypto: ccp - Update CCP driver maintainer information

2020-06-26 Thread Tom Lendacky
From: Tom Lendacky Add John Allen as a new CCP driver maintainer. Additionally, break out the driver SEV support and create a new maintainer entry, with Brijesh Singh and Tom Lendacky as maintainers. Cc: John Allen Cc: Brijesh Singh Signed-off-by: Tom Lendacky --- Changes from v1: - Change

Re: [PATCH v2] crypto: ccp - Update CCP driver maintainer information

2020-06-26 Thread John Allen
On Fri, Jun 26, 2020 at 02:09:39PM -0500, Tom Lendacky wrote: > From: Tom Lendacky > > Add John Allen as a new CCP driver maintainer. Additionally, break out > the driver SEV support and create a new maintainer entry, with Brijesh > Singh and Tom Lendacky as maintainers. > > Cc: John Allen > Cc

Re: [PATCH v2] crypto: ccp - Update CCP driver maintainer information

2020-06-26 Thread Brijesh Singh
On 6/26/20 2:09 PM, Tom Lendacky wrote: > From: Tom Lendacky > > Add John Allen as a new CCP driver maintainer. Additionally, break out > the driver SEV support and create a new maintainer entry, with Brijesh > Singh and Tom Lendacky as maintainers. > > Cc: John Allen > Cc: Brijesh Singh > Sig