Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Mathias Krause <minipli@googlemail.com>,
	Brad Spengler <spender@grsecurity.net>
Subject: Re: [PATCH] net: pre-clear the returned sockaddr_storage variable
Date: Tue, 09 Apr 2013 11:10:21 -0700	[thread overview]
Message-ID: <1365531021.3887.151.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130409175024.GA19308@www.outflux.net>

On Tue, 2013-04-09 at 10:50 -0700, Kees Cook wrote:
> To avoid future stack content leaks in the various protocols, pre-clear
> the returned memory.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Suggested-by: Brad Spengler <spender@grsecurity.net>
> ---
>  net/socket.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/socket.c b/net/socket.c
> index 88f759a..4d2af0d 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -1838,7 +1838,7 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
>  	struct socket *sock;
>  	struct iovec iov;
>  	struct msghdr msg;
> -	struct sockaddr_storage address;
> +	struct sockaddr_storage address = { };
>  	int err, err2;
>  	int fput_needed;
>  
> @@ -2185,7 +2185,7 @@ static int __sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
>  	int err, total_len, len;
>  
>  	/* kernel mode address */
> -	struct sockaddr_storage addr;
> +	struct sockaddr_storage addr = { };
>  
>  	/* user mode address pointers */
>  	struct sockaddr __user *uaddr;
> -- 
> 1.7.9.5
> 
> 

Nack, for obvious performance reasons.

  reply	other threads:[~2013-04-09 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 17:50 [PATCH] net: pre-clear the returned sockaddr_storage variable Kees Cook
2013-04-09 18:10 ` Eric Dumazet [this message]
2013-04-09 19:05 ` 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=1365531021.3887.151.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minipli@googlemail.com \
    --cc=netdev@vger.kernel.org \
    --cc=spender@grsecurity.net \
    /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