mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Dewar <alex.dewar90@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Evgeniy Polyakov <zbr@ioremap.net>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] w1: Use kfree_sensitive instead of memset+kfree
Date: Wed, 9 Sep 2020 21:30:22 +0100	[thread overview]
Message-ID: <534193cc-24be-592b-0713-1973bbb0217f@gmail.com> (raw)
In-Reply-To: <20200909194122.212486-1-alex.dewar90@gmail.com>

On 2020-09-09 20:41, Alex Dewar wrote:
> Issue identified with Coccinelle.
Hmm, on second thoughts, I'm not sure this memory is so sensitive after 
all. Should we just remove the call to memset?
>
> Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
> ---
>   drivers/w1/w1.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index e58c7592008d..4f597b0fd1da 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -71,8 +71,7 @@ static void w1_master_release(struct device *dev)
>   	struct w1_master *md = dev_to_w1_master(dev);
>   
>   	dev_dbg(dev, "%s: Releasing %s.\n", __func__, md->name);
> -	memset(md, 0, sizeof(struct w1_master) + sizeof(struct w1_bus_master));
> -	kfree(md);
> +	kfree_sensitive(md);
>   }
>   
>   static void w1_slave_release(struct device *dev)


      reply	other threads:[~2020-09-09 20:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 19:41 Alex Dewar
2020-09-09 20:30 ` Alex Dewar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=534193cc-24be-592b-0713-1973bbb0217f@gmail.com \
    --to=alex.dewar90@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®