mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@it.uu.se>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Mikael Pettersson <mikpe@it.uu.se>,
	lkml <linux-kernel@vger.kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org
Subject: Re: Is kernel optimized with dead store removal?
Date: Thu, 25 Feb 2010 17:06:07 +0100	[thread overview]
Message-ID: <19334.40943.479593.304961@pilspetsen.it.uu.se> (raw)
In-Reply-To: <4B8693B9.3060102@gmail.com>

Roel Kluin writes:
 > 
 > >  >  Does this optimization also occur during compilation of the Linux
 > >  >  kernel?
 > 
 > > Any such dead store removal is up to the compiler and the lifetime
 > > of the object being clobbered. For 'auto' objects the optimization
 > > is certainly likely.
 > > 
 > > This is only a problem if the memory (a thread stack, say) is recycled
 > > and leaked uninitialized to user-space, but such bugs are squashed
 > > fairly quickly upon discovery.
 > 
 > Thanks for comments,
 > 
 > In the sha1_update() case I don't know whether the stack is recycled and
 > leaked - it may be dependent on the calling function, but isn't it
 > vulnerable?

It's only vulnerable if the data leaks to a less trusted domain.
There is no domain crossing in your user-space example.
In the kernel case, the domain crossing would be as I wrote: leaking
recycled and uninitialized memory to user-space (and those leaks of
uninitialized memory are frowned upon and quickly fixed when discovered).

  reply	other threads:[~2010-02-25 16:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 22:13 Roel Kluin
2010-02-25 11:06 ` Mikael Pettersson
2010-02-25 15:14   ` Roel Kluin
2010-02-25 16:06     ` Mikael Pettersson [this message]
2010-02-25 18:24       ` Stefan Richter
2010-02-25 23:58       ` Henrique de Moraes Holschuh

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=19334.40943.479593.304961@pilspetsen.it.uu.se \
    --to=mikpe@it.uu.se \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roel.kluin@gmail.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

all inboxes | Powered by JetHome®