public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: netdev@vger.kernel.org, stable@kernel.org, security@kernel.org
Subject: Re: [PATCH] Prevent reading uninitialized memory with socket filters
Date: Tue, 09 Nov 2010 15:03:06 -0800	[thread overview]
Message-ID: <1289343786.28590.56.camel@Joe-Laptop> (raw)
In-Reply-To: <1289341724.7380.13.camel@dan>

On Tue, 2010-11-09 at 17:28 -0500, Dan Rosenberg wrote:
> The "mem" array used as scratch space for socket filters is not
> initialized, allowing unprivileged users to leak kernel stack bytes.

Hi Dan.

Using
	type var[count] = {};
instead of
	type var[count];
	...
	memset(var, 0, sizeof(var));

at least for gcc 4.4 and 4.5 generally results in smaller code.

$ size net/core/filter.o*
   text	   data	    bss	    dec	    hex	filename
   6751	     56	   1736	   8543	   215f	net/core/filter.o.memset
   6749	     56	   1736	   8541	   215d	net/core/filter.o.init



  reply	other threads:[~2010-11-09 23:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 22:28 [PATCH] Prevent reading uninitialized memory with socket filters Dan Rosenberg
2010-11-09 23:03 ` Joe Perches [this message]
2010-11-10  5:28 ` David Miller
2010-11-10  5:53   ` Eric Dumazet
2010-11-10  7:22     ` Eric Dumazet
2010-11-10 14:25       ` [PATCH] Prevent reading uninitialized memory with socketfilters Tetsuo Handa
2010-11-10 18:32         ` David Miller
2010-11-10 18:39         ` David Miller
2010-11-10 20:57           ` Ben Hutchings
2010-11-10 20:59             ` David Miller
2010-11-10 21:25               ` Ben Hutchings
2010-11-10 11:12   ` [PATCH] Prevent reading uninitialized memory with socket filters Dan Rosenberg
2010-11-10 13:19     ` Dan Rosenberg
2010-11-10 18:07     ` David Miller

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=1289343786.28590.56.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=drosenberg@vsecurity.com \
    --cc=netdev@vger.kernel.org \
    --cc=security@kernel.org \
    --cc=stable@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