summaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-16 22:46:05 +0100
committerDavid S. Miller <davem@davemloft.net>2019-03-17 02:19:49 +0100
commit517ccc2aa50dbd7767a9eb8e1d9987a3ed7ced3e (patch)
treebeff239c4d9e8105e6f547b3e9f2d2de2a5d7eaf /net/tipc/socket.c
parenttun: add a missing rcu_read_unlock() in error path (diff)
downloadlinux-517ccc2aa50dbd7767a9eb8e1d9987a3ed7ced3e.tar.xz
linux-517ccc2aa50dbd7767a9eb8e1d9987a3ed7ced3e.zip
net: tipc: fix a missing check for nla_nest_start
nla_nest_start may fail. The fix check its status and returns -EMSGSIZE in case it fails. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 3274ef625dba..d6b26862b34e 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -3255,6 +3255,8 @@ static int __tipc_nl_add_sk_con(struct sk_buff *skb, struct tipc_sock *tsk)
peer_port = tsk_peer_port(tsk);
nest = nla_nest_start(skb, TIPC_NLA_SOCK_CON);
+ if (!nest)
+ return -EMSGSIZE;
if (nla_put_u32(skb, TIPC_NLA_CON_NODE, peer_node))
goto msg_full;