summaryrefslogtreecommitdiffstats
path: root/net/ipv6/seg6.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-01-20 16:57:42 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-20 17:07:48 +0100
commite363116b90906f326c9cde5473b4b9a99ba476df (patch)
tree28e02e536cd1fe1982cae0dfd25c9b6604713c0c /net/ipv6/seg6.c
parentr8152: fix rtl8152_post_reset function (diff)
downloadlinux-e363116b90906f326c9cde5473b4b9a99ba476df.tar.xz
linux-e363116b90906f326c9cde5473b4b9a99ba476df.zip
ipv6: seg6_genl_set_tunsrc() must check kmemdup() return value
seg6_genl_get_tunsrc() and set_tun_src() do not handle tun_src being possibly NULL, so we must check kmemdup() return value and abort if it is NULL Fixes: 915d7e5e5930 ("ipv6: sr: add code base for control plane support of SR-IPv6") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: David Lebrun <david.lebrun@uclouvain.be> Acked-by: David Lebrun <david.lebrun@uclouvain.be> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/seg6.c')
-rw-r--r--net/ipv6/seg6.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c
index b172d85c650a..a855eb325b03 100644
--- a/net/ipv6/seg6.c
+++ b/net/ipv6/seg6.c
@@ -176,6 +176,8 @@ static int seg6_genl_set_tunsrc(struct sk_buff *skb, struct genl_info *info)
val = nla_data(info->attrs[SEG6_ATTR_DST]);
t_new = kmemdup(val, sizeof(*val), GFP_KERNEL);
+ if (!t_new)
+ return -ENOMEM;
mutex_lock(&sdata->lock);