Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kangjie Lu and committed by
David S. Miller
517ccc2a 9180bb4f

+2
+2
net/tipc/socket.c
··· 3255 3255 peer_port = tsk_peer_port(tsk); 3256 3256 3257 3257 nest = nla_nest_start(skb, TIPC_NLA_SOCK_CON); 3258 + if (!nest) 3259 + return -EMSGSIZE; 3258 3260 3259 3261 if (nla_put_u32(skb, TIPC_NLA_CON_NODE, peer_node)) 3260 3262 goto msg_full;