From: Herbert Xu Date: Fri, 23 Mar 2018 00:14:44 +0000 (+0800) Subject: crypto: lrw - Free rctx->ext with kzfree X-Git-Tag: Ubuntu-4.15.0-16.17~462 X-Git-Url: https://git.proxmox.com/?p=mirror_ubuntu-bionic-kernel.git;a=commitdiff_plain;h=67152419ab39703925701848d2eb73fbbba0b5c6 crypto: lrw - Free rctx->ext with kzfree BugLink: http://bugs.launchpad.net/bugs/1762370 commit 8c9bdab21289c211ca1ca6a5f9b7537b4a600a02 upstream. 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Thadeu Lima de Souza Cascardo --- diff --git a/crypto/lrw.c b/crypto/lrw.c index cbbd7c50ad19..1d813a6d3fec 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -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)