mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ulrich Drepper <drepper@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] information leak in sigaltstack
Date: Fri, 31 Jul 2009 14:15:48 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0907311407040.24841@localhost.localdomain> (raw)
In-Reply-To: <200907311948.n6VJm5Gf010118@hs20-bc2-1.build.redhat.com>



On Fri, 31 Jul 2009, Ulrich Drepper wrote:
> 
> The following patch should fix the issue.

Hmm. Is there any reason not to do an unconditional memset(), and then 
expect gcc to avoid the unnecessary stores? I realize gcc may not do that, 
but we could always _hope_.

Also, is there really any reason to believe that the only hole can be 
after ss_flags, and that it's only the case when ss_flags is in the 
middle? Quite frankly, as far as I can tell, you could have an "int 
ss_flags" at the _end_ of the structure too, and have the same issue 
(padding out to the alignment of the struct).

For an example of that "'int ss_flags' at the end" look at MIPS.

Now, you'd end up with a memset() in that case (since it certainly won't 
match the offsetof), but my point is, the conditional really looks very 
arbitrary and rather strange. I'd rather see it unconditional, even if it 
costs three unnecessary writes or whatever.

		Linus

  reply	other threads:[~2009-07-31 21:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31 19:48 Ulrich Drepper
2009-07-31 21:15 ` Linus Torvalds [this message]
2009-07-31 21:31   ` Linus Torvalds
2009-07-31 21:37     ` Ulrich Drepper
2009-08-01  0:28       ` Linus Torvalds
2009-08-01  7:22         ` Jakub Jelinek
2009-08-01 16:13           ` Linus Torvalds
2009-08-01 17:52         ` Linus Torvalds

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=alpine.LFD.2.01.0907311407040.24841@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=linux-kernel@vger.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

Powered by JetHome