lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e32d4067-f115-5613-f8c8-51449a2bd9b9@amd.com>
Date:   Thu, 19 Sep 2019 17:00:39 +0000
From:   Gary R Hook <ghook@....com>
To:     Navid Emamdoost <navid.emamdoost@...il.com>
CC:     "emamd001@....edu" <emamd001@....edu>,
        "smccaman@....edu" <smccaman@....edu>,
        "kjlu@....edu" <kjlu@....edu>,
        "Lendacky, Thomas" <Thomas.Lendacky@....com>,
        "Hook, Gary" <Gary.Hook@....com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] crypto: ccp - Release all allocated memory if sha type
 is invalid



On 9/19/19 11:04 AM, Navid Emamdoost wrote:
> Release all allocated memory if sha type is invalid:
> In ccp_run_sha_cmd, if the type of sha is invalid, the allocated
> hmac_buf should be released.
>
> v2: fix the goto.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>

Acked-by: Gary R Hook <gary.hook@....com>

> ---
>   drivers/crypto/ccp/ccp-ops.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
> index 9bc3c62157d7..440df9208f8f 100644
> --- a/drivers/crypto/ccp/ccp-ops.c
> +++ b/drivers/crypto/ccp/ccp-ops.c
> @@ -1782,8 +1782,9 @@ static int ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
>   			       LSB_ITEM_SIZE);
>   			break;
>   		default:
> +			kfree(hmac_buf);
>   			ret = -EINVAL;
> -			goto e_ctx;
> +			goto e_data;
>   		}
>   
>   		memset(&hmac_cmd, 0, sizeof(hmac_cmd));

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ