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: <20190916194319.712d81cc@cakuba.netronome.com>
Date:   Mon, 16 Sep 2019 19:43:19 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     zhong jiang <zhongjiang@...wei.com>
Cc:     <davem@...emloft.net>, <anna.schumaker@...app.com>,
        <trond.myklebust@...merspace.com>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] ixgbe: Use kzfree() rather than its implementation.

On Wed, 4 Sep 2019 10:39:10 +0800, zhong jiang wrote:
> Use kzfree() instead of memset() + kfree().
> 
> Signed-off-by: zhong jiang <zhongjiang@...wei.com>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
> index 31629fc..113f608 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
> @@ -960,11 +960,9 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
>  	return 0;
>  
>  err_aead:
> -	memset(xs->aead, 0, sizeof(*xs->aead));
> -	kfree(xs->aead);
> +	kzfree(xs->aead);
>  err_xs:
> -	memset(xs, 0, sizeof(*xs));
> -	kfree(xs);
> +	kzfree(xs);
>  err_out:
>  	msgbuf[1] = err;
>  	return err;
> @@ -1049,8 +1047,7 @@ int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
>  	ixgbe_ipsec_del_sa(xs);
>  
>  	/* remove the xs that was made-up in the add request */
> -	memset(xs, 0, sizeof(*xs));
> -	kfree(xs);
> +	kzfree(xs);
>  
>  	return 0;
>  }

All the crypto cases should really be converted to memzero_explicit().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ