Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1580716 > unrolled thread

[PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup()

Started byRob Rice <rob.rice@broadcom.com>
First post2017-02-14 18:50 +0100
Last post2017-02-15 06:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup() Rob Rice <rob.rice@broadcom.com> - 2017-02-14 18:50 +0100
    Re: [PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup() Herbert Xu <herbert@gondor.apana.org.au> - 2017-02-15 06:40 +0100

#1580716 — [PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup()

FromRob Rice <rob.rice@broadcom.com>
Date2017-02-14 18:50 +0100
Subject[PATCH 1/1] crypto: brcm - Avoid double free in ahash_finup()
Message-ID<taPoK-4Ol-11@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1581067

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2017-02-15 06:40 +0100
Message-ID<tb0tQ-3XX-11@gated-at.bofh.it>
In reply to#1580716
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web