public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees.cook@canonical.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	"David S. Miller" <davem@davemloft.net>,
	stable@kernel.org
Subject: Re: [PATCH] ipc: initialize structure memory to zero for shmctl
Date: Wed, 6 Oct 2010 19:13:11 -0700	[thread overview]
Message-ID: <20101007021311.GZ14666@outflux.net> (raw)
In-Reply-To: <20101007012136.GS19804@ZenIV.linux.org.uk>

Hi Al,

On Thu, Oct 07, 2010 at 02:21:36AM +0100, Al Viro wrote:
> On Wed, Oct 06, 2010 at 05:10:31PM -0700, Kees Cook wrote:
> > The old shm interface will leak a few bytes of stack contents. Explicitly
> > initialize the structure to zero-fill the untouched fields.
> 
> Umm...  I wonder if we ever have gaps in there; note that gaps between
> the fields are _not_ initialized in compound literals.  Yes, I realize
> that it's a separate problem, but explicit memset() prior to initializations
> of fields might be a better solution, covering both.

Excellent point. I'll resend with a memset.

-- 
Kees Cook
Ubuntu Security Team

      reply	other threads:[~2010-10-07  2:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07  0:10 [PATCH] ipc: initialize structure memory to zero for shmctl Kees Cook
2010-10-07  1:21 ` Al Viro
2010-10-07  2:13   ` Kees Cook [this message]

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=20101007021311.GZ14666@outflux.net \
    --to=kees.cook@canonical.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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