The buffer rctx->ext contains potentially sensitive data and should
be freed with kzfree.

Cc: <[email protected]>
Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>

diff --git a/crypto/lrw.c b/crypto/lrw.c
index a09cdaa..954a706 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -317,7 +317,7 @@ static void exit_crypt(struct skcipher_request *req)
        rctx->left = 0;
 
        if (rctx->ext)
-               kfree(rctx->ext);
+               kzfree(rctx->ext);
 }
 
 static int do_encrypt(struct skcipher_request *req, int err)
-- 
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Reply via email to