Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3138705pxb; Mon, 1 Mar 2021 02:35:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGF//YXMGvsGbYA3JXwbiSm3gUqvRNhJ0Xkj96FHwO14kQESLlazuDrmY3xkqT7sjlI02o X-Received: by 2002:a50:cd8c:: with SMTP id p12mr15924018edi.114.1614594946280; Mon, 01 Mar 2021 02:35:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614594946; cv=none; d=google.com; s=arc-20160816; b=ue+ouI9PNG0vDpgOZC6p6nJU6OHkeTmAQGemkoJ2HyKMVQaqO+XwzEG8GS8/U0BlUI AxCU0LipUFpuzOnt1dJUJ1OGSvXFB/c2WNiBe+wr6hk3pWmBLwuDCptGuao0/2Hge1kB dwXrxVosyezjnLlqVjByc6rExwxf+oNSuzJ1D2K48iy+oKU3DPUSxwsNZkeOpmNqNJDR Zsj2DKTiqysndy4Sl3M+y6R3QXViQ0i/ZfNhkLLrs6PhKy+fzL6EkWzaP2ZBau3xniGf 1D0g/7PhKOAeA8ZC4Ja7GyO0oSvl4KNX/ExF6TSeQMJ8kr3YkKkmu5yO5/vAL+2fMtU6 1DYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=zeu6AJdRVhTVyZA9Qra0bFQH/OiJADcY84efY7DYWbg=; b=k4IUfIjQSbzotJuVOv/0qgKRDPdGzbO7uuxECIo6dELObylwNt3qvBprM1NdnEdbx3 Wc33bh1lydWIGAn2uhT+8B/1n984mg8mgtVR8L4+qoWj9/msR6mUvnmwQDcu42GpH8yM fbOo7gw+GwP8Ec/dkkdHccjk5NzPAaIoUYDCtgPIbff8DmdqoyIZtYFGv7nyM8rawlXl V+MZWYz7wDSY4pGRazHVQPNB95SaSpzOVixFLycxcD8wDm7y8olBOtmE5pUWqMdV5LY3 RjuTUNScQkoX0f+pM1X88ArsWhPoFLGjbg7qz052NdOwBU/76ez0TMDTHdrnD0CEDC1+ B4CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si10815406edp.552.2021.03.01.02.35.22; Mon, 01 Mar 2021 02:35:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234518AbhCAKd2 (ORCPT + 99 others); Mon, 1 Mar 2021 05:33:28 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:53890 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233287AbhCAKdY (ORCPT ); Mon, 1 Mar 2021 05:33:24 -0500 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1lGfqU-0003D7-Mj; Mon, 01 Mar 2021 21:32:11 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Mon, 01 Mar 2021 21:32:10 +1100 Date: Mon, 1 Mar 2021 21:32:10 +1100 From: Herbert Xu To: Yang Li Cc: clabbe.montjoie@gmail.com, davem@davemloft.net, mripard@kernel.org, wens@csie.org, jernej.skrabec@siol.net, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: sun8i-ce: rename kfree() to kfree_sensitive() Message-ID: <20210301103210.GA30054@gondor.apana.org.au> References: <1614594641-35606-1-git-send-email-yang.lee@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1614594641-35606-1-git-send-email-yang.lee@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 > Signed-off-by: Yang Li > --- > 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 Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt