linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>,
	Al Viro <viro@ZenIV.linux.org.uk>
Cc: Joe Perches <joe@perches.com>, David Miller <davem@davemloft.net>,
	ben@decadent.org.uk, luis.henriques@canonical.com,
	avijitnsec@codeaurora.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: CVE-2014-9900 fix is not upstream
Date: Wed, 24 Aug 2016 22:36:08 +0200	[thread overview]
Message-ID: <18517b44-0d3f-3f83-e327-60064c170c5a@stressinduktion.org> (raw)
In-Reply-To: <20160824140316.GB14309@csclub.uwaterloo.ca>

On 24.08.2016 16:03, Lennart Sorensen wrote:
> On Tue, Aug 23, 2016 at 10:25:45PM +0100, Al Viro wrote:
>> Sadly, sizeof is what we use when copying that sucker to userland.  So these
>> padding bits in the end would've leaked, true enough, and the case is somewhat
>> weaker.  And any normal architecture will have those, but then any such
>> architecture will have no more trouble zeroing a 32bit value than 16bit one.
> 
> Hmm, good point.  Too bad I don't see a compiler option of "zero all
> padding in structs".  Certainly generating the code should not really
> be that different.
> 
> I see someone did request it 2 years ago:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63479

I don't think this is sufficient. Basically if you write one field in a
struct after a memset again, the compiler is allowed by the standard to
write padding bytes again, causing them to be undefined.

If we want to go down this route, probably the only option is to add
__attribute__((pack)) those structs to just have no padding at all, thus
breaking uapi.

E.g. the x11 protocol implementation specifies padding bytes in their
binary representation of the wire protocol to limit the leaking:

https://cgit.freedesktop.org/xorg/proto/xproto/tree/Xproto.h

... which would be another option.

Bye,
Hannes

  reply	other threads:[~2016-08-24 20:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 13:41 CVE-2014-9900 fix is not upstream Luis Henriques
2016-08-23 13:41 ` net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Luis Henriques
2016-08-23 14:06   ` Joe Perches
     [not found]     ` <CAOp4FwRxfE61azV78TZ7EKESQZzRU2Pfkc2GJ9j3MV7pr80qew@mail.gmail.com>
2016-08-23 15:40       ` Joe Perches
2016-08-23 14:21   ` Eric Dumazet
2016-08-23 15:05     ` Joe Perches
2016-08-23 15:36       ` Eric Dumazet
2016-08-23 16:38         ` Andrey Ryabinin
2016-08-23 16:46         ` Edward Cree
2016-08-23 17:15       ` Vegard Nossum
2016-08-23 17:33     ` Ben Hutchings
2016-08-23 16:40 ` CVE-2014-9900 fix is not upstream David Miller
2016-08-23 17:35   ` Ben Hutchings
2016-08-23 18:24     ` David Miller
2016-08-23 20:09       ` Al Viro
2016-08-23 20:34         ` Joe Perches
2016-08-23 20:49           ` Lennart Sorensen
2016-08-23 21:25             ` Al Viro
2016-08-24 14:03               ` Lennart Sorensen
2016-08-24 20:36                 ` Hannes Frederic Sowa [this message]
2016-08-25 12:40                   ` Johannes Berg
2016-08-25 12:41                     ` Johannes Berg
2016-08-25 15:14                   ` One Thousand Gnomes

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=18517b44-0d3f-3f83-e327-60064c170c5a@stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=avijitnsec@codeaurora.org \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsorense@csclub.uwaterloo.ca \
    --cc=luis.henriques@canonical.com \
    --cc=netdev@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).