All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Hartkopp <oliver@hartkopp.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH net-2.6] can: Fix raw_getname() leak
Date: Fri, 07 Aug 2009 08:31:59 +0200	[thread overview]
Message-ID: <4A7BCA5F.9050102@hartkopp.net> (raw)
In-Reply-To: <4A7BC938.8010504@gmail.com>

Eric Dumazet wrote:
> raw_getname() can leak 10 bytes of kernel memory to user
> 
> (two bytes hole between can_family and can_ifindex,
> 8 bytes at the end of sockaddr_can structure)
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Acked-by: Oliver Hartkopp <oliver@hartkopp.net>

Thanks Eric!

> ---
> diff --git a/net/can/raw.c b/net/can/raw.c
> index f4cc445..db3152d 100644
> --- a/net/can/raw.c
> +++ b/net/can/raw.c
> @@ -401,6 +401,7 @@ static int raw_getname(struct socket *sock, struct sockaddr *uaddr,
>  	if (peer)
>  		return -EOPNOTSUPP;
>  
> +	memset(addr, 0, sizeof(*addr));
>  	addr->can_family  = AF_CAN;
>  	addr->can_ifindex = ro->ifindex;
>  


  reply	other threads:[~2009-08-07  6:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07  6:27 [PATCH net-2.6] can: Fix raw_getname() leak Eric Dumazet
2009-08-07  6:31 ` Oliver Hartkopp [this message]
2009-08-10  4:52   ` 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=4A7BCA5F.9050102@hartkopp.net \
    --to=oliver@hartkopp.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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.