From: Giel van Schijndel <me@mortis.eu>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
"maintainer:X86 ARCHITECTURE..." <x86@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Steve French <sfrench@samba.org>,
Rahul Bedarkar <rahulbedarkar89@gmail.com>,
Thomas Pugliese <thomas.pugliese@gmail.com>,
Randy Dunlap <rdunlap@infradead.org>,
Julia Lawall <Julia.Lawall@lip6.fr>,
"open list:CRYPTO API" <linux-crypto@vger.kernel.org>,
"open list:CERTIFIED WIRELES..." <linux-usb@vger.kernel.org>,
"open list:COMMON INTERNET F..." <linux-cifs@vger.kernel.org>,
"moderated list:COMMON INTERNET F..."
<samba-technical@lists.samba.org>,
Daniel Borkmann <dborkman@redhat.com>
Subject: Re: [PATCH] Use memzero_explicit to clear local buffers
Date: Tue, 6 Jan 2015 20:42:26 +0100 [thread overview]
Message-ID: <20150106194226.GM4806@salidar.dom.custoft.eu> (raw)
In-Reply-To: <20150104233637.GA20757@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]
On Mon, Jan 05, 2015 at 10:36:37 +1100, Herbert Xu wrote:
> On Sun, Jan 04, 2015 at 11:49:09PM +0100, Giel van Schijndel wrote:
>>
>>> sctx does not point to stack memory so this is bogus.
>>>
>>> Only stack memory cleared just before it goes out of scope needs
>>> memzero_explicit.
>>
>> Is that because the compiler can't safely optimize memset(0) away for a
>> variable with greater-than-local scope?
>
> Exactly. memzero_explicit is not a marker for sensitive data.
> Its only purpose is to prevent the compiler from optimising away
> zeroing that occurs at the end of a scope.
Question: are you sure the compiler won't optimize the call to memset(0)
way if it's immediately followed by kfree()?
Because one of my changes concerns that situation.
Another actually does change a stack-allocated buffer, I'll split that
one off right away.
--
Met vriendelijke groet,
With kind regards,
Giel van Schijndel
--
"When all you have is a hammer, everything starts to look like a nail."
-- Abraham Maslow
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2015-01-06 19:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-04 18:05 Giel van Schijndel
2015-01-04 21:35 ` Herbert Xu
2015-01-04 22:49 ` Giel van Schijndel
2015-01-04 23:36 ` Herbert Xu
2015-01-06 19:42 ` Giel van Schijndel [this message]
2015-01-06 20:54 ` Herbert Xu
2015-01-04 23:05 ` Giel van Schijndel
2015-01-06 21:37 ` [PATCH RESEND] cifs: use memzero_explicit to clear stack buffer Giel van Schijndel
2015-01-06 22:59 ` Herbert Xu
2015-01-13 0:12 ` Steve French
2015-01-09 18:53 ` Steve French
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=20150106194226.GM4806@salidar.dom.custoft.eu \
--to=me@mortis.eu \
--cc=Julia.Lawall@lip6.fr \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=hpa@zytor.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rahulbedarkar89@gmail.com \
--cc=rdunlap@infradead.org \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=tglx@linutronix.de \
--cc=thomas.pugliese@gmail.com \
--cc=x86@kernel.org \
/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®