Netlink attributes have a maximum length of 64k. It's theoretically
possible that a packet could exceed this length, so check for it before
we try to send the packet to userspace.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
if (unlikely(err))
goto err_kfree_skbs;
+ if (nla_attr_size(skb->len) > USHRT_MAX)
+ goto err_kfree_skbs;
+
len = sizeof(struct odp_header);
len += nla_total_size(skb->len);
len += nla_total_size(FLOW_BUFSIZE);