* [PATCH net] rtnetlink: fix VF info size
@ 2014-08-08 14:44 Jiri Benc
2014-08-08 17:34 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Benc @ 2014-08-08 14:44 UTC (permalink / raw)
To: netdev; +Cc: Rony Efraim
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 <ypei@redhat.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
---
net/core/rtnetlink.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 8d39071f32d7..f0493e3b7471 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -804,7 +804,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_spoofchk)) +
- nla_total_size(sizeof(struct ifla_vf_rate)));
+ nla_total_size(sizeof(struct ifla_vf_rate)) +
+ nla_total_size(sizeof(struct ifla_vf_link_state)));
return size;
} else
return 0;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] rtnetlink: fix VF info size
2014-08-08 14:44 [PATCH net] rtnetlink: fix VF info size Jiri Benc
@ 2014-08-08 17:34 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-08-08 17:34 UTC (permalink / raw)
To: jbenc; +Cc: netdev, ronye
From: Jiri Benc <jbenc@redhat.com>
Date: Fri, 8 Aug 2014 16:44:32 +0200
> 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 <ypei@redhat.com>
> Signed-off-by: Jiri Benc <jbenc@redhat.com>
Applied and queued up for -stable, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-08 17:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-08 14:44 [PATCH net] rtnetlink: fix VF info size Jiri Benc
2014-08-08 17:34 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).