linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup()
@ 2017-02-14 17:45 Rob Rice
  2017-02-15  5:35 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Rice @ 2017-02-14 17:45 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Dan Carpenter, linux-crypto,
	linux-kernel, bcm-kernel-feedback-list
  Cc: Rob Rice

In Broadcom SPU driver, in case where incremental hash
is done in software in ahash_finup(), tmpbuf was freed
twice.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rob Rice <rob.rice@broadcom.com>
---
 drivers/crypto/bcm/cipher.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c
index a654a01..cc0d5b9 100644
--- a/drivers/crypto/bcm/cipher.c
+++ b/drivers/crypto/bcm/cipher.c
@@ -2331,7 +2331,6 @@ static int ahash_finup(struct ahash_request *req)
 		/* Call synchronous update */
 		ret = crypto_shash_finup(ctx->shash, tmpbuf, req->nbytes,
 					 req->result);
-		kfree(tmpbuf);
 	} else {
 		/* Otherwise call the internal function which uses SPU hw */
 		return __ahash_finup(req);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup()
  2017-02-14 17:45 [PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup() Rob Rice
@ 2017-02-15  5:35 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2017-02-15  5:35 UTC (permalink / raw)
  To: Rob Rice
  Cc: David S. Miller, Dan Carpenter, linux-crypto, linux-kernel,
	bcm-kernel-feedback-list

On Tue, Feb 14, 2017 at 12:45:52PM -0500, Rob Rice wrote:
> In Broadcom SPU driver, in case where incremental hash
> is done in software in ahash_finup(), tmpbuf was freed
> twice.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Rob Rice <rob.rice@broadcom.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-15  5:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 17:45 [PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup() Rob Rice
2017-02-15  5:35 ` Herbert Xu

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).