From: Jiri Benc Date: Fri, 8 Aug 2014 14:44:32 +0000 (+0200) Subject: rtnetlink: fix VF info size X-Git-Tag: v3.14.22~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f97ac5241397af66c8f5bf6790f634ea7ad86bf;p=profile%2Fcommon%2Fkernel-common.git rtnetlink: fix VF info size [ Upstream commit 945a36761fd7877660f630bbdeb4ff9ff80d1935 ] Commit 1d8faf48c74b8 ("net/core: Add VF link state control") added new attribute to IFLA_VF_INFO group in rtnl_fill_ifinfo but did not adjust size of the allocated memory in if_nlmsg_size/rtnl_vfinfo_size. As the result, we may trigger warnings in rtnl_getlink and similar functions when many VF links are enabled, as the information does not fit into the allocated skb. Fixes: 1d8faf48c74b8 ("net/core: Add VF link state control") Reported-by: Yulong Pei Signed-off-by: Jiri Benc Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index aef1500..b0db904 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -799,7 +799,8 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev, (nla_total_size(sizeof(struct ifla_vf_mac)) + nla_total_size(sizeof(struct ifla_vf_vlan)) + nla_total_size(sizeof(struct ifla_vf_tx_rate)) + - nla_total_size(sizeof(struct ifla_vf_spoofchk))); + nla_total_size(sizeof(struct ifla_vf_spoofchk)) + + nla_total_size(sizeof(struct ifla_vf_link_state))); return size; } else return 0;