All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Clement LECIGNE <clement.lecigne@netasq.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] 8 bytes kernel memory disclosure in AppleTalk getsockname.
Date: Wed, 26 Aug 2009 14:35:57 +0200	[thread overview]
Message-ID: <4A952C2D.2010807@gmail.com> (raw)
In-Reply-To: <20090826111247.GA79673@clem1.netasq.com>

Clement LECIGNE a écrit :
> Hi,
> 
> In function atalk_getname(), sockaddr_at is returned in userland without
> zero'ing the "char sat_zero[8]" field. This bug allows user to display 8
> bytes leaked from the kernel stack.
> 
> Here is a patch that zero the whole sockaddr_at structure before
> processing it. It should fix this bug.
> 
> Signed-off-by: Clément Lecigne <clement.lecigne@netasq.com>
> --- linux/net/appletalk/ddp.c	2009-08-26 11:35:59.000000000 +0200
> +++ linux/net/appletalk/ddp.c	2009-08-26 11:36:30.000000000 +0200
> @@ -1241,6 +1241,8 @@ static int atalk_getname(struct socket *
>  		if (atalk_autobind(sk) < 0)
>  			return -ENOBUFS;
>  
> +	memset(&sat, 0, sizeof(struct sockaddr_at));
> +
>  	*uaddr_len = sizeof(struct sockaddr_at);
>  
>  	if (peer) {
> 
Hi Clement

Well, I submitted same patch some weeks ago and I just checked that
it was already in Linus tree.

author	Eric Dumazet <eric.dumazet@gmail.com>
	Thu, 6 Aug 2009 02:27:43 +0000 (02:27 +0000)
committer	David S. Miller <davem@davemloft.net>
	Thu, 6 Aug 2009 20:08:45 +0000 (13:08 -0700)
commit	3d392475c873c10c10d6d96b94d092a34ebd4791

appletalk: fix atalk_getname() leak

atalk_getname() can leak 8 bytes of kernel memory to user

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


Dont worry, it'll be included in upcoming 2.6.31 kernel,
and backported to previous ones as well.

  parent reply	other threads:[~2009-08-26 12:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26 11:12 [PATCH] 8 bytes kernel memory disclosure in AppleTalk getsockname Clement LECIGNE
2009-08-26 12:01 ` Tetsuo Handa
2009-08-26 12:38   ` Eric Dumazet
2009-08-26 12:35 ` Eric Dumazet [this message]
2009-08-26 12:39   ` Clement LECIGNE

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=4A952C2D.2010807@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=clement.lecigne@netasq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.