All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ying Xue <ying.xue@windriver.com>
To: Sasha Levin <sasha.levin@oracle.com>, <linux-kernel@vger.kernel.org>
Cc: <erik.hugne@ericsson.com>, <jon.maloy@ericsson.com>,
	<davem@davemloft.net>,
	Allan Stephens <allan.stephens@windriver.com>,
	open list: TIPC NETWORK LAYER <netdev@vger.kernel.org>,
	"; open list": TIPC NETWORK LAYER
	<tipc-discussion@lists.sourceforge.net>, ;
Subject: Re: [PATCH] tipc: validate length of sockaddr in connect() for dgram/rdm
Date: Tue, 24 Mar 2015 17:11:12 +0800	[thread overview]
Message-ID: <55112A30.2050800@windriver.com> (raw)
In-Reply-To: <1427139003-30510-1-git-send-email-sasha.levin@oracle.com>

On 03/24/2015 03:30 AM, Sasha Levin wrote:
> Commit f2f8036 ("tipc: add support for connect() on dgram/rdm sockets")
> hasn't validated user input length for the sockaddr structure which allows
> a user to overwrite kernel memory with arbitrary input.
> 
> Fixes: f2f8036 ("tipc: add support for connect() on dgram/rdm sockets")
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

Acked-by: Ying Xue <ying.xue@windriver.com>

> ---
>  net/tipc/socket.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/tipc/socket.c b/net/tipc/socket.c
> index 73c2f51..986dc96 100644
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -1852,6 +1852,8 @@ static int tipc_connect(struct socket *sock, struct sockaddr *dest,
>  		if (dst->family == AF_UNSPEC) {
>  			memset(&tsk->remote, 0, sizeof(struct sockaddr_tipc));
>  			tsk->connected = 0;
> +		} else if (destlen != sizeof(struct sockaddr_tipc)) {
> +			res = -EINVAL;
>  		} else {
>  			memcpy(&tsk->remote, dest, destlen);
>  			tsk->connected = 1;
> 


  reply	other threads:[~2015-03-24  9:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 19:30 [PATCH] tipc: validate length of sockaddr in connect() for dgram/rdm Sasha Levin
2015-03-24  9:11 ` Ying Xue [this message]
2015-03-24 16:57 ` 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=55112A30.2050800@windriver.com \
    --to=ying.xue@windriver.com \
    --cc=allan.stephens@windriver.com \
    --cc=davem@davemloft.net \
    --cc=erik.hugne@ericsson.com \
    --cc=jon.maloy@ericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sasha.levin@oracle.com \
    /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.