linux/net/openvswitch
Jesse Gross ae688bc6a5 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: Sasha Levin <sasha.levin@oracle.com>
History 2015-10-27 09:33:03 -04:00
..
actions.c vlan: rename __vlan_put_tag to vlan_insert_tag_set_proto 2015-04-27 16:48:33 -04:00
datapath.c openvswitch: Zero flows on allocation. 2015-10-27 09:33:03 -04:00
datapath.h openvswitch: Wrap struct ovs_key_ipv4_tunnel in a new structure. 2014-10-06 00:32:20 -04:00
dp_notify.c genetlink: make multicast groups const, prevent abuse 2013-11-19 16:39:06 -05:00
flow.c openvswitch: Set flow-key members. 2014-10-17 23:54:02 -04:00
flow.h openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
flow_netlink.c openvswitch: Fix flow mask validation. 2014-12-16 09:39:05 -08:00
flow_netlink.h openvswitch: refactor ovs flow extract API. 2014-09-15 23:28:13 -07:00
flow_table.c openvswitch: Zero flows on allocation. 2015-10-27 09:33:03 -04:00
flow_table.h openvswitch: Zero flows on allocation. 2015-10-27 09:33:03 -04:00
Kconfig openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
Makefile openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
vport-geneve.c openvswitch: kerneldoc warning fix 2014-10-15 23:25:33 -04:00
vport-gre.c vlan: introduce *vlan_hwaccel_push_inside helpers 2015-04-27 16:48:34 -04:00
vport-internal_dev.c openvswitch: Enable tunnel GSO for OVS bridge. 2014-07-24 01:15:04 -07:00
vport-internal_dev.h openvswitch: introduce rtnl ops stub 2014-07-01 14:40:17 -07:00
vport-netdev.c openvswitch: fix vport-netdev unregister 2013-10-16 14:50:22 -07:00
vport-netdev.h openvswitch: fix vport-netdev unregister 2013-10-16 14:50:22 -07:00
vport-vxlan.c openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
vport.c openvswitch: use vport instead of p 2014-10-15 23:25:33 -04:00
vport.h openvswitch: Fix net exit. 2015-03-14 15:37:11 -04:00