diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c index bff6bc75cfb75b57c6e972cdb418d40f569aea51..45e3f1b552e0deb2ec3e0b9d291120d53e7ca14e 100644 --- a/net/ipv6/seg6.c +++ b/net/ipv6/seg6.c @@ -135,6 +135,11 @@ static int seg6_genl_sethmac(struct sk_buff *skb, struct genl_info *info) goto out_unlock; } + if (slen > nla_len(info->attrs[SEG6_ATTR_SECRET])) { + err = -EINVAL; + goto out_unlock; + } + if (hinfo) { err = seg6_hmac_info_del(net, hmackeyid); if (err)