From: Herbert Xu Date: Fri, 23 Mar 2018 00:14:44 +0000 (+0800) Subject: crypto: lrw - Free rctx->ext with kzfree X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8c9bdab21289c211ca1ca6a5f9b7537b4a600a02;p=linux.git crypto: lrw - Free rctx->ext with kzfree The buffer rctx->ext contains potentially sensitive data and should be freed with kzfree. Cc: Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher") Reported-by: Dan Carpenter Signed-off-by: Herbert Xu --- diff --git a/crypto/lrw.c b/crypto/lrw.c index a09cdaa6ddf3b..954a7064a179d 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)