From: mancha security <mancha1@zoho.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org,
Theodore Ts'o <tytso@mit.edu>,
Stephan Mueller <smueller@chronox.de>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
Mark Charlebois <charlebm@gmail.com>,
Behan Webster <behanw@converseincode.com>
Subject: Re: [PATCH crypto-2.6] lib: make memzero_explicit more robust against dead store elimination
Date: Wed, 29 Apr 2015 14:54:00 +0000 [thread overview]
Message-ID: <20150429145400.GA12861@zoho.com> (raw)
In-Reply-To: <5540E42F.70607@iogearbox.net>
[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]
On Wed, Apr 29, 2015 at 04:01:19PM +0200, Daniel Borkmann wrote:
> On 04/29/2015 03:08 PM, mancha security wrote:
> ...
> >By the way, has anyone been able to verify that __memory_barrier
> >provides DSE protection under various optimizations? Unfortunately, I
> >don't have ready access to ICC at the moment or I'd test it myself.
>
> Never used icc, but it looks like it's free for open source projects;
> I can give it a try, but in case you're faster than I am, feel free
> to post results here.
Time permitting, I'll try setting this up and post my results.
>
> From what I see based on the code, i.e. after that buggy cleanup
> commit ...
>
> commit 73679e50820123ebdedc67ebcda4562d1d6e4aba
> Author: Pranith Kumar <bobby.prani@gmail.com>
> Date: Tue Apr 15 12:05:22 2014 -0400
>
> compiler-intel.h: Remove duplicate definition
>
> barrier is already defined as __memory_barrier in compiler.h
> Remove this unnecessary redefinition.
>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> Link: http://lkml.kernel.org/r/CAJhHMCAnYPy0%2BqD-1KBnJPLt3XgAjdR12j%2BySSnPgmZcpbE7HQ@mail.gmail.com
> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
>
> ... it looks like it's currently using the _same_ gcc inline asm
> for the barrier on icc instead of what that commit intended to do.
>
> So funny enough, we don't actually use __memory_barrier() at the
> moment. ;)
>
> Nonetheless, having a look might be good.
Nice catch, 73679e50820 is indeed buggy because ICC defines __GNUC__
(unless -no-gcc is used). That should be reverted.
Bug aside, according to [1], ICC does support GNU-style inline asm so
for the purposes of barrier_data(), it would be interesting to see if
it affords better/worse DSE protection compared to __memory_barrier().
--mancha
[1]
https://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-5100C4FC-BC2F-4E36-943A-120CFFFB4285.htm
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-04-29 14:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 15:22 [PATCH crypto-2.6] lib: make memzero_explicit more robust against dead store elimination Daniel Borkmann
2015-04-28 21:37 ` Stephan Mueller
2015-04-29 13:08 ` mancha security
2015-04-29 14:01 ` Daniel Borkmann
2015-04-29 14:54 ` mancha security [this message]
2015-04-29 23:43 ` Daniel Borkmann
2015-04-30 6:17 ` mancha security
2015-04-29 14:56 ` Daniel Borkmann
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=20150429145400.GA12861@zoho.com \
--to=mancha1@zoho.com \
--cc=behanw@converseincode.com \
--cc=charlebm@gmail.com \
--cc=daniel@iogearbox.net \
--cc=hannes@stressinduktion.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=smueller@chronox.de \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.