Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Tudor-Dan Ambarus <tudor-dan.ambarus@nxp.com>
Cc: "herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"tadeusz.struk@intel.com" <tadeusz.struk@intel.com>,
	Cristian Stoica <cristian.stoica@nxp.com>,
	Horia Ioan Geanta Neag <horia.geanta@nxp.com>
Subject: Re: [PATCH v3 2/3] crypto: rsa_helper - add raw integer parser actions
Date: Thu, 14 Apr 2016 17:38:08 +0200	[thread overview]
Message-ID: <1694759.CAoKSHjcSd@tauon.atsec.com> (raw)
In-Reply-To: <AM3PR04MB1300D3E01F404CA61D833C3DB8970@AM3PR04MB1300.eurprd04.prod.outlook.com>

Am Donnerstag, 14. April 2016, 15:25:17 schrieb Tudor-Dan Ambarus:

Hi Tudor,

> > 
> > > +{
> > > +	if (key->d) {
> > > +		memset(key->d, '\0', key->n_sz);
> > 
> > memzero_explicit, please
> 
> I don't think this is really needed. memzero_explicit is used only on stack
> variables that get cleared just before they go out of scope.

Are you so sure that a compiler is not getting smart on seeing a memset 
followed by a free without marking the pointer as volatile? You free the 
pointer immediately after memset(). I would not want to bet anything that a 
compiler would leave the memset for non-volatile pointers.

Besides, memzero_expicit does not cost anything -- it does not add any 
instruction but convinces the compiler to not optimize it away.

Ciao
Stephan

  reply	other threads:[~2016-04-14 15:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 13:37 [PATCH v3 0/3] crypto: rsa - generalize ASN.1 sequences Tudor Ambarus
2016-04-06 13:37 ` [PATCH v3 1/3] " Tudor Ambarus
2016-04-15 13:52   ` Herbert Xu
2016-04-15 14:32     ` Tudor-Dan Ambarus
2016-04-15 14:38       ` Herbert Xu
2016-04-15 15:03         ` Tudor-Dan Ambarus
2016-04-25  5:54           ` Tudor-Dan Ambarus
2016-04-25  5:58             ` Herbert Xu
2016-04-06 13:37 ` [PATCH v3 2/3] crypto: rsa_helper - add raw integer parser actions Tudor Ambarus
2016-04-08 16:32   ` Stephan Mueller
2016-04-14 15:25     ` Tudor-Dan Ambarus
2016-04-14 15:38       ` Stephan Mueller [this message]
2016-04-15  5:58         ` Herbert Xu
2016-04-08 16:54   ` Jeffrey Walton
2016-04-08 16:55     ` Stephan Mueller
2016-04-08 17:09       ` Jeffrey Walton
2016-04-08 17:13         ` Stephan Mueller
2016-04-06 13:37 ` [PATCH v3 3/3] crypto: rsa_helper - export symbols for asn1 structures Tudor Ambarus

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=1694759.CAoKSHjcSd@tauon.atsec.com \
    --to=smueller@chronox.de \
    --cc=cristian.stoica@nxp.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=tadeusz.struk@intel.com \
    --cc=tudor-dan.ambarus@nxp.com \
    /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