<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/openvswitch/datapath.c, branch v3.14.57</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>openvswitch: Zero flows on allocation.</title>
<updated>2015-10-01T09:36:23+00:00</updated>
<author>
<name>Jesse Gross</name>
<email>jesse@nicira.com</email>
</author>
<published>2015-09-22T03:21:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6f6e8414631dd4bde7e0e29e9cab41d7e7c92970'/>
<id>6f6e8414631dd4bde7e0e29e9cab41d7e7c92970</id>
<content type='text'>
[ Upstream commit ae5f2fb1d51fa128a460bcfbe3c56d7ab8bf6a43 ]

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 &lt;jesse@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit ae5f2fb1d51fa128a460bcfbe3c56d7ab8bf6a43 ]

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 &lt;jesse@nicira.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors</title>
<updated>2014-03-27T19:29:38+00:00</updated>
<author>
<name>Zoltan Kiss</name>
<email>zoltan.kiss@citrix.com</email>
</author>
<published>2014-03-26T22:37:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=36d5fe6a000790f56039afe26834265db0a3ad4c'/>
<id>36d5fe6a000790f56039afe26834265db0a3ad4c</id>
<content type='text'>
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the callers so they will signal the failed delivery towards the creator of the
skb.

Signed-off-by: Zoltan Kiss &lt;zoltan.kiss@citrix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the callers so they will signal the failed delivery towards the creator of the
skb.

Signed-off-by: Zoltan Kiss &lt;zoltan.kiss@citrix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Fix race.</title>
<updated>2014-02-16T01:42:29+00:00</updated>
<author>
<name>Jarno Rajahalme</name>
<email>jrajahalme@nicira.com</email>
</author>
<published>2014-02-16T01:42:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=42ee19e2939277a5277c307e517ce2d7ba5f0703'/>
<id>42ee19e2939277a5277c307e517ce2d7ba5f0703</id>
<content type='text'>
ovs_vport_cmd_dump() did rcu_read_lock() only after getting the
datapath, which could have been deleted in between.  Resolved by
taking rcu_read_lock() before the get_dp() call.

Signed-off-by: Jarno Rajahalme &lt;jrajahalme@nicira.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ovs_vport_cmd_dump() did rcu_read_lock() only after getting the
datapath, which could have been deleted in between.  Resolved by
taking rcu_read_lock() before the get_dp() call.

Signed-off-by: Jarno Rajahalme &lt;jrajahalme@nicira.com&gt;
Signed-off-by: Pravin B Shelar &lt;pshelar@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ovs: fix dp check in ovs_dp_reset_user_features</title>
<updated>2014-02-16T01:24:19+00:00</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2014-02-14T10:42:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3c7eacfc8a9a4c2bd48e0093c4f43cf69afd5210'/>
<id>3c7eacfc8a9a4c2bd48e0093c4f43cf69afd5210</id>
<content type='text'>
This fixes crash when userspace does "ovs-dpctl add-dp dev" where dev is
existing non-dp netdevice.

Introduced by:
commit 44da5ae5fbea4686f667dc854e5ea16814e44c59
"openvswitch: Drop user features if old user space attempted to create datapath"

Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes crash when userspace does "ovs-dpctl add-dp dev" where dev is
existing non-dp netdevice.

Introduced by:
commit 44da5ae5fbea4686f667dc854e5ea16814e44c59
"openvswitch: Drop user features if old user space attempted to create datapath"

Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Suppress error messages on megaflow updates</title>
<updated>2014-02-05T06:32:38+00:00</updated>
<author>
<name>Andy Zhou</name>
<email>azhou@nicira.com</email>
</author>
<published>2014-02-03T01:08:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c14e0953ca51dbcb8d1ac92acbdcff23d0caa158'/>
<id>c14e0953ca51dbcb8d1ac92acbdcff23d0caa158</id>
<content type='text'>
With subfacets, we'd expect megaflow updates message to carry
the original micro flow. If not, EINVAL is returned and kernel
logs an error message.  Now that the user space subfacet layer is
removed, it is expected that flow updates can arrive with a
micro flow other than the original. Change the return code to
EEXIST and remove the kernel error log message.

Reported-by: Ben Pfaff &lt;blp@nicira.com&gt;
Signed-off-by: Andy Zhou &lt;azhou@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With subfacets, we'd expect megaflow updates message to carry
the original micro flow. If not, EINVAL is returned and kernel
logs an error message.  Now that the user space subfacet layer is
removed, it is expected that flow updates can arrive with a
micro flow other than the original. Change the return code to
EEXIST and remove the kernel error log message.

Reported-by: Ben Pfaff &lt;blp@nicira.com&gt;
Signed-off-by: Andy Zhou &lt;azhou@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Fix ovs_dp_cmd_msg_size()</title>
<updated>2014-02-05T06:21:23+00:00</updated>
<author>
<name>Daniele Di Proietto</name>
<email>daniele.di.proietto@gmail.com</email>
</author>
<published>2014-01-23T18:47:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=45fb9c35b27c9982e9a55d04ed0a5230a2d0b306'/>
<id>45fb9c35b27c9982e9a55d04ed0a5230a2d0b306</id>
<content type='text'>
commit 43d4be9cb55f3bac5253e9289996fd9d735531db (openvswitch: Allow user space
to announce ability to accept unaligned Netlink messages) introduced
OVS_DP_ATTR_USER_FEATURES netlink attribute in datapath responses,
but the attribute size was not taken into account in ovs_dp_cmd_msg_size().

Signed-off-by: Daniele Di Proietto &lt;daniele.di.proietto@gmail.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 43d4be9cb55f3bac5253e9289996fd9d735531db (openvswitch: Allow user space
to announce ability to accept unaligned Netlink messages) introduced
OVS_DP_ATTR_USER_FEATURES netlink attribute in datapath responses,
but the attribute size was not taken into account in ovs_dp_cmd_msg_size().

Signed-off-by: Daniele Di Proietto &lt;daniele.di.proietto@gmail.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Fix kernel panic on ovs_flow_free</title>
<updated>2014-02-05T06:21:17+00:00</updated>
<author>
<name>Andy Zhou</name>
<email>azhou@nicira.com</email>
</author>
<published>2014-01-21T17:31:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e80857cce82da31e41a6599fc888dfc92e0167cc'/>
<id>e80857cce82da31e41a6599fc888dfc92e0167cc</id>
<content type='text'>
Both mega flow mask's reference counter and per flow table mask list
should only be accessed when holding ovs_mutex() lock. However
this is not true with ovs_flow_table_flush(). The patch fixes this bug.

Reported-by: Joe Stringer &lt;joestringer@nicira.com&gt;
Signed-off-by: Andy Zhou &lt;azhou@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both mega flow mask's reference counter and per flow table mask list
should only be accessed when holding ovs_mutex() lock. However
this is not true with ovs_flow_table_flush(). The patch fixes this bug.

Reported-by: Joe Stringer &lt;joestringer@nicira.com&gt;
Signed-off-by: Andy Zhou &lt;azhou@nicira.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Pad OVS_PACKET_ATTR_PACKET if linear copy was performed</title>
<updated>2014-02-05T06:21:11+00:00</updated>
<author>
<name>Thomas Graf</name>
<email>tgraf@suug.ch</email>
</author>
<published>2014-01-14T16:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=aea0bb4f8ee513537ad84b9f3f609f96e272d98e'/>
<id>aea0bb4f8ee513537ad84b9f3f609f96e272d98e</id>
<content type='text'>
While the zerocopy method is correctly omitted if user space
does not support unaligned Netlink messages. The attribute is
still not padded correctly as skb_zerocopy() will not ensure
padding and the attribute size is no longer pre calculated
though nla_reserve() which ensured padding previously.

This patch applies appropriate padding if a linear data copy
was performed in skb_zerocopy().

Signed-off-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Acked-by: Zoltan Kiss &lt;zoltan.kiss@citrix.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While the zerocopy method is correctly omitted if user space
does not support unaligned Netlink messages. The attribute is
still not padded correctly as skb_zerocopy() will not ensure
padding and the attribute size is no longer pre calculated
though nla_reserve() which ensured padding previously.

This patch applies appropriate padding if a linear data copy
was performed in skb_zerocopy().

Signed-off-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Acked-by: Zoltan Kiss &lt;zoltan.kiss@citrix.com&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ovs: make functions local</title>
<updated>2014-01-06T23:54:39+00:00</updated>
<author>
<name>Stephen Hemminger</name>
<email>stephen@networkplumber.org</email>
</author>
<published>2013-12-17T19:22:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=443cd88c8a31379e95326428bbbd40af25c1d440'/>
<id>443cd88c8a31379e95326428bbbd40af25c1d440</id>
<content type='text'>
Several functions and datastructures could be local
Found with 'make namespacecheck'

Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Several functions and datastructures could be local
Found with 'make namespacecheck'

Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: Compute checksum in skb_gso_segment() if needed</title>
<updated>2014-01-06T23:53:24+00:00</updated>
<author>
<name>Thomas Graf</name>
<email>tgraf@suug.ch</email>
</author>
<published>2013-12-13T14:22:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=09c5e6054e206ecf13945f50711856a5cb2d5de1'/>
<id>09c5e6054e206ecf13945f50711856a5cb2d5de1</id>
<content type='text'>
The copy &amp; csum optimization is no longer present with zerocopy
enabled. Compute the checksum in skb_gso_segment() directly by
dropping the HW CSUM capability from the features passed in.

Signed-off-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The copy &amp; csum optimization is no longer present with zerocopy
enabled. Compute the checksum in skb_gso_segment() directly by
dropping the HW CSUM capability from the features passed in.

Signed-off-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Signed-off-by: Jesse Gross &lt;jesse@nicira.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
