From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE61CEB64DB for ; Thu, 15 Jun 2023 09:10:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240422AbjFOJKf (ORCPT ); Thu, 15 Jun 2023 05:10:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245504AbjFOJJz (ORCPT ); Thu, 15 Jun 2023 05:09:55 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF8B730CB; Thu, 15 Jun 2023 02:09:14 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1q9iyU-003G7R-4O; Thu, 15 Jun 2023 17:09:03 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Thu, 15 Jun 2023 17:09:02 +0800 Date: Thu, 15 Jun 2023 17:09:02 +0800 From: Herbert Xu To: "Adam, Mahmoud" Cc: Mahmoud Adam , "dhowells@redhat.com" , "davem@davemloft.net" , "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] KEYS: use kfree_sensitive with key Message-ID: References: <20230613160723.61729-1-mngyadam@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org On Wed, Jun 14, 2023 at 01:32:51PM +0000, Adam, Mahmoud wrote: > > I think this holds for the other lines as well, I can use pkey->key_is_private to check for them also That might be going a bit overboard. So if the key is definitely public, then use kfree. If we don't know what it is (i.e., public or private), then just use kfree_sensitive. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt