crypto: lrw - Free rctx->ext with kzfree
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 23 Mar 2018 00:14:44 +0000 (08:14 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Mar 2018 17:33:10 +0000 (01:33 +0800)
The buffer rctx->ext contains potentially sensitive data and should
be freed with kzfree.

Cc: <stable@vger.kernel.org>
Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/lrw.c

index a09cdaa6ddf3bc5510be836c8258597cbf3f9ea0..954a7064a179dc0ddac8f37d7e9838d4fb38e2e7 100644 (file)
@@ -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)