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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Apr 2018 12:26:31 +0000 (14:26 +0200)
commit 8c9bdab21289c211ca1ca6a5f9b7537b4a600a02 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/lrw.c

index eb681e9fe5743fb4b539622bf90cbe966f7219c3..fdba6dd6db635c4b98b6406e07f175a56c7aec1f 100644 (file)
@@ -313,7 +313,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)