diff options
author | Jesse Gross <jesse@nicira.com> | 2015-09-21 20:21:20 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-22 17:33:41 -0700 |
commit | ae5f2fb1d51fa128a460bcfbe3c56d7ab8bf6a43 (patch) | |
tree | 7e05a2752e98068a8d19d95ccad191f896e73b12 /net/openvswitch/flow_table.h | |
parent | 53adc9e83028d9e35b6408231ebaf62a94a16e4d (diff) | |
download | linux-stable-ae5f2fb1d51fa128a460bcfbe3c56d7ab8bf6a43.tar.gz linux-stable-ae5f2fb1d51fa128a460bcfbe3c56d7ab8bf6a43.tar.bz2 linux-stable-ae5f2fb1d51fa128a460bcfbe3c56d7ab8bf6a43.zip |
openvswitch: Zero flows on allocation.
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>
Diffstat (limited to 'net/openvswitch/flow_table.h')
-rw-r--r-- | net/openvswitch/flow_table.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/openvswitch/flow_table.h b/net/openvswitch/flow_table.h index 616eda10d955..2dd9900f533d 100644 --- a/net/openvswitch/flow_table.h +++ b/net/openvswitch/flow_table.h @@ -86,5 +86,5 @@ struct sw_flow *ovs_flow_tbl_lookup_ufid(struct flow_table *, bool ovs_flow_cmp(const struct sw_flow *, const struct sw_flow_match *); void ovs_flow_mask_key(struct sw_flow_key *dst, const struct sw_flow_key *src, - const struct sw_flow_mask *mask); + bool full, const struct sw_flow_mask *mask); #endif /* flow_table.h */ |