projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9180bb4
)
net: tipc: fix a missing check for nla_nest_start
author
Kangjie Lu
<kjlu@umn.edu>
Sat, 16 Mar 2019 21:46:05 +0000
(16:46 -0500)
committer
David S. Miller
<davem@davemloft.net>
Sun, 17 Mar 2019 01:19:49 +0000
(18:19 -0700)
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>
net/tipc/socket.c
patch
|
blob
|
blame
|
history
diff --git
a/net/tipc/socket.c
b/net/tipc/socket.c
index 3274ef625dba1b3417405d8537b4b30e919d44d1..d6b26862b34e88fae713c97e4c1dca20ec0d2d5e 100644
(file)
--- 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;