[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140424155106.GD2864@minipsycho.orion>
Date: Thu, 24 Apr 2014 17:51:06 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: David Gibson <david@...son.dropbear.id.au>
Cc: netdev@...r.kernel.org, ssujith@...co.com, neepatel@...co.com,
benve@...co.com, davem@...emloft.net, ben@...adent.org.uk,
govindarajulu90@...il.com, gregory.v.rose@...el.com
Subject: Re: [PATCH 2/2] rtnetlink: Only supply IFLA_VF_PORTS information
when RTEXT_FILTER_VF is set
Thu, Apr 24, 2014 at 02:22:36AM CEST, david@...son.dropbear.id.au wrote:
>Since 115c9b81928360d769a76c632bae62d15206a94a (rtnetlink: Fix problem with
>buffer allocation), RTM_NEWLINK messages only contain the IFLA_VFINFO_LIST
>attribute if they were solicited by a GETLINK message containing an
>IFLA_EXT_MASK attribute with the RTEXT_FILTER_VF flag.
>
>That was done because some user programs broke when they received more data
>than expected - because IFLA_VFINFO_LIST contains information for each VF
>it can become large if there are many VFs.
>
>However, the IFLA_VF_PORTS attribute, supplied for devices which implement
>ndo_get_vf_port (currently the 'enic' driver only), has the same problem.
>It supplies per-VF information and can therefore become large, but it is
>not currently conditional on the IFLA_EXT_MASK value.
>
>Worse, it interacts badly with the existing EXT_MASK handling. When
>IFLA_EXT_MASK is not supplied, the buffer for netlink replies is fixed at
>NLMSG_GOODSIZE. If the information for IFLA_VF_PORTS exceeds this, then
>rtnl_fill_ifinfo() returns -EMSGSIZE on the first message in a packet.
>netlink_dump() will misinterpret this as having finished the listing and
>omit data for this interface and all subsequent ones. That can cause
>getifaddrs(3) to enter an infinite loop.
>
>This patch addresses the problem by only supplying IFLA_VF_PORTS when
>IFLA_EXT_MASK is supplied with the RTEXT_FILTER_VF flag set.
>
>Signed-off-by: David Gibson <david@...son.dropbear.id.au>
Reviewed-by: Jiri Pirko <jiri@...nulli.us>
This should go to -net I believe.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists