From: Sasha Levin <sasha.levin@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: erik.hugne@ericsson.com, ying.xue@windriver.com,
jon.maloy@ericsson.com, davem@davemloft.net,
Sasha Levin <sasha.levin@oracle.com>,
Allan Stephens <allan.stephens@windriver.com>,
netdev@vger.kernel.org (open list:TIPC NETWORK LAYER),
tipc-discussion@lists.sourceforge.net (open list:TIPC NETWORK
LAYER)
Subject: [PATCH] tipc: validate length of sockaddr in connect() for dgram/rdm
Date: Mon, 23 Mar 2015 15:30:00 -0400 [thread overview]
Message-ID: <1427139003-30510-1-git-send-email-sasha.levin@oracle.com> (raw)
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>
---
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;
--
1.7.10.4
next reply other threads:[~2015-03-23 19:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 19:30 Sasha Levin [this message]
2015-03-24 9:11 ` [PATCH] tipc: validate length of sockaddr in connect() for dgram/rdm Ying Xue
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=1427139003-30510-1-git-send-email-sasha.levin@oracle.com \
--to=sasha.levin@oracle.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=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).