[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427139003-30510-1-git-send-email-sasha.levin@oracle.com>
Date: Mon, 23 Mar 2015 15:30:00 -0400
From: Sasha Levin <sasha.levin@...cle.com>
To: linux-kernel@...r.kernel.org
Cc: erik.hugne@...csson.com, ying.xue@...driver.com,
jon.maloy@...csson.com, davem@...emloft.net,
Sasha Levin <sasha.levin@...cle.com>,
Allan Stephens <allan.stephens@...driver.com>,
netdev@...r.kernel.org (open list:TIPC NETWORK LAYER),
tipc-discussion@...ts.sourceforge.net (open list:TIPC NETWORK LAYER)
Subject: [PATCH] tipc: validate length of sockaddr in connect() for dgram/rdm
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@...cle.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists