Crypto Fixes for 4.7

2016-07-22 Thread Herbert Xu
Hi Linus: This push fixes a sporadic build failure in the qat driver as well as a memory corruption bug in rsa-pkcs1pad. Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git linus Herbert Xu (1): crypto: rsa-pkcs1pad - fix rsa-pkcs1pad request struct Ja

[PATCH] crypto: marvell - Update cache with input sg only when it is unmapped

2016-07-22 Thread Romain Perier
So far, the cache of the ahash requests was updated from the 'complete' operation. This complete operation is called from mv_cesa_tdma_process before the cleanup operation, which means that the content of req->src can be read and copied when it is still mapped. This commit fixes the issue by moving

[PATCH 1/2] crypto: ixp4xx - Fix a "simple if" coding style warning

2016-07-22 Thread Quentin Lambert
Signed-off-by: Quentin Lambert --- drivers/crypto/ixp4xx_crypto.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -447,9 +447,8 @@ static int init_ixp_crypto(struct device if (!npe_running(npe_c)) {

[PATCH 2/2] crypto: ixp4xx - Add missing npe_c release in error branches

2016-07-22 Thread Quentin Lambert
Most error branches following the call to npe_request contain a call to npe_request. This patch add a call to npe_release to error branches following the call to npe_request that do not have it. This issue was found with Hector. Signed-off-by: Quentin Lambert --- If I am right in thinking that

[PATCH 0/2] Fix a resource release omission in error handling code

2016-07-22 Thread Quentin Lambert
The first patch is a style fix, the second add calls to npe_release. The reason for me thinking that they are necessary is that every other branches leading to an error return are calling this function. --- drivers/crypto/ixp4xx_crypto.c |9 + 1 file changed, 5 insertions(+), 4 deleti

Re: [PATCH] crypto: marvell - Don't chain at DMA level when backlog is disabled

2016-07-22 Thread Boris Brezillon
On Fri, 22 Jul 2016 14:40:55 +0200 Romain Perier wrote: > The flag CRYPTO_TFM_REQ_MAY_BACKLOG is optional and can be set from the > user to put requests into the backlog queue when the main cryptographic > queue is full. Before calling mv_cesa_tdma_chain we must check the value > of the return st

Re: [PATCH] crypto: marvell - Fix memory leaks in TDMA chain for cipher requests

2016-07-22 Thread Boris Brezillon
On Fri, 22 Jul 2016 14:40:39 +0200 Romain Perier wrote: > So far in mv_cesa_ablkcipher_dma_req_init, if an error is thrown while > the tdma chain is built there is a memory leak. This issue exists > because the chain is assigned later at the end of the function, so the > cleanup function is calle

[PATCH] crypto: marvell - Don't chain at DMA level when backlog is disabled

2016-07-22 Thread Romain Perier
The flag CRYPTO_TFM_REQ_MAY_BACKLOG is optional and can be set from the user to put requests into the backlog queue when the main cryptographic queue is full. Before calling mv_cesa_tdma_chain we must check the value of the return status to be sure that the current request has been correctly queued

[PATCH] crypto: marvell - Fix memory leaks in TDMA chain for cipher requests

2016-07-22 Thread Romain Perier
So far in mv_cesa_ablkcipher_dma_req_init, if an error is thrown while the tdma chain is built there is a memory leak. This issue exists because the chain is assigned later at the end of the function, so the cleanup function is called with the wrong version of the chain. Fixes: db509a45339f ("cryp