[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210301103210.GA30054@gondor.apana.org.au>
Date: Mon, 1 Mar 2021 21:32:10 +1100
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Yang Li <yang.lee@...ux.alibaba.com>
Cc: clabbe.montjoie@...il.com, davem@...emloft.net, mripard@...nel.org,
wens@...e.org, jernej.skrabec@...l.net,
linux-crypto@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: sun8i-ce: rename kfree() to kfree_sensitive()
On Mon, Mar 01, 2021 at 06:30:41PM +0800, Yang Li wrote:
> Rename kfree() to kfree_sensitive() to make the intention of the API
> more explicit.
>
> fixed the following coccicheck:
> ./drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c:30:16-17: WARNING
> opportunity for kfree_sensitive/kvfree_sensitive (memset at line 29)
> ./drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c:42:16-17: WARNING
> opportunity for kfree_sensitive/kvfree_sensitive (memset at line 41)
> ./drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c:161:8-9: WARNING
> opportunity for kfree_sensitive/kvfree_sensitive (memset at line 109)
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
> ---
> drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c
> index cfde9ee..8259d52 100644
> --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c
> +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c
> @@ -27,7 +27,7 @@ void sun8i_ce_prng_exit(struct crypto_tfm *tfm)
> struct sun8i_ce_rng_tfm_ctx *ctx = crypto_tfm_ctx(tfm);
>
> memzero_explicit(ctx->seed, ctx->slen);
> - kfree(ctx->seed);
> + kfree_sensitive(ctx->seed);
Any reason why you're keeping the memzero?
Thanks,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists