linux/net/openvswitch
Jesse Gross 6d80e35071 openvswitch: Zero flows on allocation.
[ Upstream commit ae5f2fb1d5 ]

When support for megaflows was introduced, OVS needed to start
installing flows with a mask applied to them. Since masking is an
expensive operation, OVS also had an optimization that would only
take the parts of the flow keys that were covered by a non-zero
mask. The values stored in the remaining pieces should not matter
because they are masked out.

While this works fine for the purposes of matching (which must always
look at the mask), serialization to netlink can be problematic. Since
the flow and the mask are serialized separately, the uninitialized
portions of the flow can be encoded with whatever values happen to be
present.

In terms of functionality, this has little effect since these fields
will be masked out by definition. However, it leaks kernel memory to
userspace, which is a potential security vulnerability. It is also
possible that other code paths could look at the masked key and get
uninitialized data, although this does not currently appear to be an
issue in practice.

This removes the mask optimization for flows that are being installed.
This was always intended to be the case as the mask optimizations were
really targetting per-packet flow operations.

Fixes: 03f0d916 ("openvswitch: Mega flow implementation")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2015-10-03 13:49:16 +02:00
..
actions.c net: openvswitch: Support masked set actions. 2015-02-07 22:40:17 -08:00
datapath.c openvswitch: Zero flows on allocation. 2015-10-03 13:49:16 +02:00
datapath.h net: Introduce possible_net_t 2015-03-12 14:39:40 -04:00
dp_notify.c genetlink: make multicast groups const, prevent abuse 2013-11-19 16:39:06 -05:00
flow.c mm: remove GFP_THISNODE 2015-04-14 16:49:03 -07:00
flow.h openvswitch: Add support for unique flow IDs. 2015-01-26 15:45:50 -08:00
flow_netlink.c netlink: implement nla_get_in_addr and nla_get_in6_addr 2015-03-31 13:58:35 -04:00
flow_netlink.h openvswitch: Add support for unique flow IDs. 2015-01-26 15:45:50 -08:00
flow_table.c openvswitch: Zero flows on allocation. 2015-10-03 13:49:16 +02:00
flow_table.h openvswitch: Zero flows on allocation. 2015-10-03 13:49:16 +02:00
Kconfig mpls: Fix the openvswitch select of NET_MPLS_GSO 2015-03-08 19:30:06 -04:00
Makefile ovs: Turn vports with dependencies into separate modules 2014-10-28 14:43:18 -04:00
vport-geneve.c openvswitch: Add support for checksums on UDP tunnels. 2015-01-28 23:04:15 -08:00
vport-gre.c openvswitch: Introduce ovs_tunnel_route_lookup 2015-01-14 16:32:06 -05:00
vport-internal_dev.c openvswitch: Drop packets when interdev is not up 2014-11-05 23:52:35 -08:00
vport-internal_dev.h openvswitch: introduce rtnl ops stub 2014-07-01 14:40:17 -07:00
vport-netdev.c openvswitch: disable LRO 2015-06-03 19:39:35 -07:00
vport-netdev.h ovs: Turn vports with dependencies into separate modules 2014-10-28 14:43:18 -04:00
vport-vxlan.c udp_tunnel: Pass UDP socket down through udp_tunnel{, 6}_xmit_skb(). 2015-04-07 15:29:08 -04:00
vport-vxlan.h openvswitch: Support VXLAN Group Policy extension 2015-01-15 01:11:41 -05:00
vport.c openvswitch: Return vport module ref before destruction 2015-03-31 15:59:50 -04:00
vport.h openvswitch: Fix net exit. 2015-02-20 15:32:08 -05:00