[PATCH] crypto: cavium/nitrox - Use after free in process_response_list()

2019-01-03 Thread Dan Carpenter
We free "sr" and then dereference it on the next line. Fixes: c9613335bf4f ("crypto: cavium/nitrox - Added AEAD cipher support") Signed-off-by: Dan Carpenter --- drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/cavium

Re: [PATCH v1 1/2] dt/bindings: add bindings for optional optee rng-uuid property

2019-01-03 Thread Sumit Garg
On Thu, 3 Jan 2019 at 22:44, Daniel Thompson wrote: > > On Fri, Dec 28, 2018 at 02:41:01PM +0530, Sumit Garg wrote: > > On Thu, 27 Dec 2018 at 19:10, Ard Biesheuvel > > wrote: > > > > > > On Thu, 27 Dec 2018 at 12:08, Sumit Garg wrote: > > > > > > > > Add bindings for OP-TEE based optional hard

[PATCH 14/16] crypto: arc4 - convert to skcipher API

2019-01-03 Thread Eric Biggers
From: Eric Biggers Convert the "ecb(arc4)" algorithm from the deprecated "blkcipher" API to the "skcipher" API. (Note that this is really a stream cipher and not a block cipher in ECB mode as the name implies, but that's a problem for another day...) Signed-off-by: Eric Biggers --- crypto/arc

[PATCH 15/16] crypto: null - convert ecb-cipher_null to skcipher API

2019-01-03 Thread Eric Biggers
From: Eric Biggers Convert the "ecb-cipher_null" algorithm from the deprecated "blkcipher" API to the "skcipher" API. Signed-off-by: Eric Biggers --- crypto/crypto_null.c | 57 +--- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/crypto/c

[PATCH 16/16] crypto: algapi - remove crypto_alloc_instance()

2019-01-03 Thread Eric Biggers
From: Eric Biggers Now that all "blkcipher" templates have been converted to "skcipher", crypto_alloc_instance() is no longer used. And it's not useful any longer as it creates an old-style weakly typed instance rather than a new-style strongly typed instance. So remove it, and now that the nam

[PATCH 13/16] crypto: pcbc - convert to skcipher_alloc_instance_simple()

2019-01-03 Thread Eric Biggers
From: Eric Biggers The PCBC template just wraps a single block cipher algorithm, so simplify it by converting it to use skcipher_alloc_instance_simple(). Signed-off-by: Eric Biggers --- crypto/pcbc.c | 125 +- 1 file changed, 11 insertions(+), 11

[PATCH 11/16] crypto: ofb - convert to skcipher_alloc_instance_simple()

2019-01-03 Thread Eric Biggers
From: Eric Biggers The OFB template just wraps a single block cipher algorithm, so simplify it by converting it to use skcipher_alloc_instance_simple(). Cc: Gilad Ben-Yossef Signed-off-by: Eric Biggers --- crypto/ofb.c | 119 +++ 1 file changed,

[PATCH 10/16] crypto: keywrap - convert to skcipher API

2019-01-03 Thread Eric Biggers
From: Eric Biggers Convert the keywrap template from the deprecated "blkcipher" API to the "skcipher" API, taking advantage of skcipher_alloc_instance_simple() to simplify it considerably. Cc: Stephan Mueller Signed-off-by: Eric Biggers --- crypto/keywrap.c | 198 -

[PATCH 04/16] crypto: pcbc - remove bogus memcpy()s with src == dest

2019-01-03 Thread Eric Biggers
From: Eric Biggers The memcpy()s in the PCBC implementation use walk->iv as both the source and destination, which has undefined behavior. These memcpy()'s are actually unneeded, because walk->iv is already used to hold the previous plaintext block XOR'd with the previous ciphertext block. Thus

[PATCH 01/16] crypto: cfb - add missing 'chunksize' property

2019-01-03 Thread Eric Biggers
From: Eric Biggers Like some other block cipher mode implementations, the CFB implementation assumes that while walking through the scatterlist, a partial block does not occur until the end. But the walk is incorrectly being done with a blocksize of 1, as 'cra_blocksize' is set to 1 (since CFB i

[PATCH 08/16] crypto: ctr - convert to skcipher API

2019-01-03 Thread Eric Biggers
From: Eric Biggers Convert the CTR template from the deprecated "blkcipher" API to the "skcipher" API, taking advantage of skcipher_alloc_instance_simple() to simplify it considerably. Signed-off-by: Eric Biggers --- crypto/ctr.c | 160 +-- 1 fil

[PATCH 09/16] crypto: ecb - convert to skcipher API

2019-01-03 Thread Eric Biggers
From: Eric Biggers Convert the ECB template from the deprecated "blkcipher" API to the "skcipher" API, taking advantage of skcipher_alloc_instance_simple() to simplify it considerably. Signed-off-by: Eric Biggers --- crypto/ecb.c | 151 --- 1 fil

[PATCH 07/16] crypto: cfb - convert to skcipher_alloc_instance_simple()

2019-01-03 Thread Eric Biggers
From: Eric Biggers The CFB template just wraps a single block cipher algorithm, so simplify it by converting it to use skcipher_alloc_instance_simple(). Cc: James Bottomley Signed-off-by: Eric Biggers --- crypto/cfb.c | 127 --- 1 file changed,

[PATCH 12/16] crypto: pcbc - remove ability to wrap internal ciphers

2019-01-03 Thread Eric Biggers
From: Eric Biggers Following commit 944585a64f5e ("crypto: x86/aes-ni - remove special handling of AES in PCBC mode"), it's no longer needed for the PCBC template to support wrapping a cipher that has the CRYPTO_ALG_INTERNAL flag set. Thus, remove this now-unused functionality to make PCBC consi

[PATCH 05/16] crypto: skcipher - add helper for simple block cipher modes

2019-01-03 Thread Eric Biggers
From: Eric Biggers The majority of skcipher templates (including both the existing ones and the ones remaining to be converted from the "blkcipher" API) just wrap a single block cipher algorithm. This includes cbc, cfb, ctr, ecb, kw, ofb, and pcbc. Add a helper function skcipher_alloc_instance_

[PATCH 03/16] crypto: ofb - fix handling partial blocks and make thread-safe

2019-01-03 Thread Eric Biggers
From: Eric Biggers Fix multiple bugs in the OFB implementation: 1. It stored the per-request state 'cnt' in the tfm context, which can be used by multiple threads concurrently (e.g. via AF_ALG). 2. It didn't support messages not a multiple of the block cipher size, despite being a stream c

[PATCH 02/16] crypto: cfb - remove bogus memcpy() with src == dest

2019-01-03 Thread Eric Biggers
From: Eric Biggers The memcpy() in crypto_cfb_decrypt_inplace() uses walk->iv as both the source and destination, which has undefined behavior. It is unneeded because walk->iv is already used to hold the previous ciphertext block; thus, walk->iv is already updated to its final value. So, remove

[PATCH 00/16] crypto: skcipher template simplifications and conversions

2019-01-03 Thread Eric Biggers
Hello, This series adds a function skcipher_alloc_instance_simple() that greatly simplifies creating an skcipher_instance that uses a single underlying block cipher. It then converts the cbc, cfb, ctr, ecb, kw, ofb, and pcbc templates to use it. In doing so, ctr, ecb, and kw are also converted f

[PATCH 06/16] crypto: cbc - convert to skcipher_alloc_instance_simple()

2019-01-03 Thread Eric Biggers
From: Eric Biggers The CBC template just wraps a single block cipher algorithm, so simplify it by converting it to use skcipher_alloc_instance_simple(). Signed-off-by: Eric Biggers --- crypto/cbc.c | 131 +-- 1 file changed, 13 insertions(+), 118

Re: [PATCH v1 1/2] dt/bindings: add bindings for optional optee rng-uuid property

2019-01-03 Thread Daniel Thompson
On Fri, Dec 28, 2018 at 02:41:01PM +0530, Sumit Garg wrote: > On Thu, 27 Dec 2018 at 19:10, Ard Biesheuvel > wrote: > > > > On Thu, 27 Dec 2018 at 12:08, Sumit Garg wrote: > > > > > > Add bindings for OP-TEE based optional hardware random number > > > generator identifier property. It could be u

Re: [PATCH v1 1/2] dt/bindings: add bindings for optional optee rng-uuid property

2019-01-03 Thread Rob Herring
On Thu, Dec 27, 2018 at 7:40 AM Ard Biesheuvel wrote: > > On Thu, 27 Dec 2018 at 12:08, Sumit Garg wrote: > > > > Add bindings for OP-TEE based optional hardware random number > > generator identifier property. It could be used on ARM based devices > > where entropy source is not accessible to no

Re: IPSec ESN: Packets decryption fail with ESN enabled connection

2019-01-03 Thread Harsh Jain
On 02-01-2019 18:21, Herbert Xu wrote: > On Wed, Dec 26, 2018 at 03:16:29PM +0530, Harsh Jain wrote: >> +linux-crypto >> >> On 26-12-2018 14:54, Harsh Jain wrote: >>> Hi All, >>> >>> Kernel version on both machines: 4.19.7. >>> >>> Packet drops with EBADMSG is observed on receive end of connectio

[PATCH] crypto:authencesn: Avoid twice completion call in decrypt path

2019-01-03 Thread Harsh Jain
Authencesn template in decrypt path unconditionally calls aead_request_complete after ahash_verify which leads to following kernel panic in after decryption. [ 338.539800] BUG: unable to handle kernel NULL pointer dereference at 0004 [ 338.548372] PGD 0 P4D 0 [ 338.551157] Oops: 00