<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/net/veth.c, branch linux-3.9.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>veth: fix NULL dereference in veth_dellink()</title>
<updated>2013-02-11T01:41:43+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-02-08T20:10:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f45a5c267da35174e22cec955093a7513dc1623d'/>
<id>f45a5c267da35174e22cec955093a7513dc1623d</id>
<content type='text'>
commit d0e2c55e7c940 (veth: avoid a NULL deref in veth_stats_one)
added another NULL deref in veth_dellink().

# ip link add name veth1 type veth peer name veth0
# rmmod veth

We crash because veth_dellink() is called twice, so we must
take care of NULL peer.

Signed-off-by: Eric Dumazet &lt;edumazet@google.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>
commit d0e2c55e7c940 (veth: avoid a NULL deref in veth_stats_one)
added another NULL deref in veth_dellink().

# ip link add name veth1 type veth peer name veth0
# rmmod veth

We crash because veth_dellink() is called twice, so we must
take care of NULL peer.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>veth: fix a NULL deref in netif_carrier_off</title>
<updated>2013-01-10T22:11:46+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-01-10T08:32:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2efd32ee1b60b0b31404ca47c1ce70e5a5d24ebc'/>
<id>2efd32ee1b60b0b31404ca47c1ce70e5a5d24ebc</id>
<content type='text'>
In commit d0e2c55e7c94 (veth: avoid a NULL deref in veth_stats_one)
we now clear the peer pointers in veth_dellink()

veth_close() must therefore make sure the peer pointer is set.

Reported-by: Tom Parkin &lt;tom.parkin@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.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>
In commit d0e2c55e7c94 (veth: avoid a NULL deref in veth_stats_one)
we now clear the peer pointers in veth_dellink()

veth_close() must therefore make sure the peer pointer is set.

Reported-by: Tom Parkin &lt;tom.parkin@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>veth: avoid a NULL deref in veth_stats_one</title>
<updated>2013-01-08T03:42:50+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-01-04T15:42:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d0e2c55e7c940a3ee91e9e23a2683b593690f1e9'/>
<id>d0e2c55e7c940a3ee91e9e23a2683b593690f1e9</id>
<content type='text'>
commit 2681128f0ced8a (veth: extend device features) added a NULL deref
in veth_stats_one(), as veth_get_stats64() was not testing if the peer
device was setup or not.

At init time, we call dev_get_stats() before veth pair is fully setup.

[  178.854758]  [&lt;ffffffffa00f5677&gt;] veth_get_stats64+0x47/0x70 [veth]
[  178.861013]  [&lt;ffffffff814f0a2d&gt;] dev_get_stats+0x6d/0x130
[  178.866486]  [&lt;ffffffff81504efc&gt;] rtnl_fill_ifinfo+0x47c/0x930
[  178.872299]  [&lt;ffffffff81505b93&gt;] rtmsg_ifinfo+0x83/0x100
[  178.877678]  [&lt;ffffffff81505cc6&gt;] rtnl_configure_link+0x76/0xa0
[  178.883580]  [&lt;ffffffffa00f52fa&gt;] veth_newlink+0x16a/0x350 [veth]
[  178.889654]  [&lt;ffffffff815061cc&gt;] rtnl_newlink+0x4dc/0x5e0
[  178.895128]  [&lt;ffffffff81505e1e&gt;] ? rtnl_newlink+0x12e/0x5e0
[  178.900769]  [&lt;ffffffff8150587d&gt;] rtnetlink_rcv_msg+0x11d/0x310
[  178.906669]  [&lt;ffffffff81505760&gt;] ? __rtnl_unlock+0x20/0x20
[  178.912225]  [&lt;ffffffff81521f89&gt;] netlink_rcv_skb+0xa9/0xd0
[  178.917779]  [&lt;ffffffff81502d55&gt;] rtnetlink_rcv+0x25/0x40
[  178.923159]  [&lt;ffffffff815218d1&gt;] netlink_unicast+0x1b1/0x230
[  178.928887]  [&lt;ffffffff81521c4e&gt;] netlink_sendmsg+0x2fe/0x3b0
[  178.934615]  [&lt;ffffffff814dbe22&gt;] sock_sendmsg+0xd2/0xf0

So we must check if peer was setup in veth_get_stats64()

As pointed out by Ben Hutchings, priv-&gt;peer is missing proper
synchronization. Adding RCU protection is a safe and well documented
way to make sure we don't access about to be freed or already
freed data.

Reported-by: Tom Parkin &lt;tparkin@katalix.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
CC: Ben Hutchings &lt;bhutchings@solarflare.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>
commit 2681128f0ced8a (veth: extend device features) added a NULL deref
in veth_stats_one(), as veth_get_stats64() was not testing if the peer
device was setup or not.

At init time, we call dev_get_stats() before veth pair is fully setup.

[  178.854758]  [&lt;ffffffffa00f5677&gt;] veth_get_stats64+0x47/0x70 [veth]
[  178.861013]  [&lt;ffffffff814f0a2d&gt;] dev_get_stats+0x6d/0x130
[  178.866486]  [&lt;ffffffff81504efc&gt;] rtnl_fill_ifinfo+0x47c/0x930
[  178.872299]  [&lt;ffffffff81505b93&gt;] rtmsg_ifinfo+0x83/0x100
[  178.877678]  [&lt;ffffffff81505cc6&gt;] rtnl_configure_link+0x76/0xa0
[  178.883580]  [&lt;ffffffffa00f52fa&gt;] veth_newlink+0x16a/0x350 [veth]
[  178.889654]  [&lt;ffffffff815061cc&gt;] rtnl_newlink+0x4dc/0x5e0
[  178.895128]  [&lt;ffffffff81505e1e&gt;] ? rtnl_newlink+0x12e/0x5e0
[  178.900769]  [&lt;ffffffff8150587d&gt;] rtnetlink_rcv_msg+0x11d/0x310
[  178.906669]  [&lt;ffffffff81505760&gt;] ? __rtnl_unlock+0x20/0x20
[  178.912225]  [&lt;ffffffff81521f89&gt;] netlink_rcv_skb+0xa9/0xd0
[  178.917779]  [&lt;ffffffff81502d55&gt;] rtnetlink_rcv+0x25/0x40
[  178.923159]  [&lt;ffffffff815218d1&gt;] netlink_unicast+0x1b1/0x230
[  178.928887]  [&lt;ffffffff81521c4e&gt;] netlink_sendmsg+0x2fe/0x3b0
[  178.934615]  [&lt;ffffffff814dbe22&gt;] sock_sendmsg+0xd2/0xf0

So we must check if peer was setup in veth_get_stats64()

As pointed out by Ben Hutchings, priv-&gt;peer is missing proper
synchronization. Adding RCU protection is a safe and well documented
way to make sure we don't access about to be freed or already
freed data.

Reported-by: Tom Parkin &lt;tparkin@katalix.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
CC: Ben Hutchings &lt;bhutchings@solarflare.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>veth: extend device features</title>
<updated>2012-12-30T10:31:59+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-12-29T16:26:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8093315a91340bca52549044975d8c7f673b28a1'/>
<id>8093315a91340bca52549044975d8c7f673b28a1</id>
<content type='text'>
veth is lacking most modern facilities, like SG, checksums, TSO.

It makes sense to extend dev-&gt;features to get them, or GRO aggregation
is defeated by a forced segmentation.

Reported-by: Andrew Vagin &lt;avagin@parallels.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&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>
veth is lacking most modern facilities, like SG, checksums, TSO.

It makes sense to extend dev-&gt;features to get them, or GRO aggregation
is defeated by a forced segmentation.

Reported-by: Andrew Vagin &lt;avagin@parallels.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>veth: reduce stat overhead</title>
<updated>2012-12-30T10:31:58+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-12-29T16:02:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2681128f0ced8aa4e66f221197e183cc16d244fe'/>
<id>2681128f0ced8aa4e66f221197e183cc16d244fe</id>
<content type='text'>
veth stats are a bit bloated. There is no need to account transmit
and receive stats, since they are absolutely symmetric.

Also use a per device atomic64_t for the dropped counter, as it
should never be used in fast path.

Signed-off-by: Eric Dumazet &lt;edumazet@google.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>
veth stats are a bit bloated. There is no need to account transmit
and receive stats, since they are absolutely symmetric.

Also use a per device atomic64_t for the dropped counter, as it
should never be used in fast path.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtnelink: remove unused parameter from rtnl_create_link().</title>
<updated>2012-11-30T17:24:40+00:00</updated>
<author>
<name>Rami Rosen</name>
<email>ramirose@gmail.com</email>
</author>
<published>2012-11-30T01:08:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c07135633bee3f01a6454d15b6411f32cfbeb2fd'/>
<id>c07135633bee3f01a6454d15b6411f32cfbeb2fd</id>
<content type='text'>
This patch removes an unused parameter (src_net) from rtnl_create_link()
method and from the method single invocation, in veth.
This parameter was used in the past when calling
ops-&gt;get_tx_queues(src_net, tb) in rtnl_create_link().
The get_tx_queues() member of rtnl_link_ops was replaced by two methods,
get_num_tx_queues() and get_num_rx_queues(), which do not get any
parameter. This was done in commit d40156aa5ecbd51fed932ed4813df82b56e5ff4d by
Jiri Pirko ("rtnl: allow to specify different num for rx and tx queue count").

Signed-off-by: Rami Rosen &lt;ramirose@gmail.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>
This patch removes an unused parameter (src_net) from rtnl_create_link()
method and from the method single invocation, in veth.
This parameter was used in the past when calling
ops-&gt;get_tx_queues(src_net, tb) in rtnl_create_link().
The get_tx_queues() member of rtnl_link_ops was replaced by two methods,
get_num_tx_queues() and get_num_rx_queues(), which do not get any
parameter. This was done in commit d40156aa5ecbd51fed932ed4813df82b56e5ff4d by
Jiri Pirko ("rtnl: allow to specify different num for rx and tx queue count").

Signed-off-by: Rami Rosen &lt;ramirose@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>veth: allow changing the mac address while interface is up</title>
<updated>2012-11-01T16:26:10+00:00</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2012-10-30T16:22:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=23ea5a963768ff162a9ff8654589d7f7e1dfb780'/>
<id>23ea5a963768ff162a9ff8654589d7f7e1dfb780</id>
<content type='text'>
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&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>
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>veth: Allow to create peer link with given ifindex</title>
<updated>2012-08-09T23:18:07+00:00</updated>
<author>
<name>Pavel Emelyanov</name>
<email>xemul@parallels.com</email>
</author>
<published>2012-08-08T21:53:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e6f8f1a739b652c56e6f959d6714d92e05621e21'/>
<id>e6f8f1a739b652c56e6f959d6714d92e05621e21</id>
<content type='text'>
The ifinfomsg is in there (thanks kaber@ for foreseeing this long time ago),
so take the given ifidex and register netdev with it.

Ben noticed, that this code path previously ignored ifmp-&gt;ifi_index and
userland could be passing in garbage. Thus it may now fail occasionally
because the value clashes with an existing interface.

To address this it's assumed that if the caller specifies the ifindex for
the veth master device, then it's aware of this possibility and should
explicitly specify (or set to 0 for auto-assignment) the peer's ifindex as
well. With this the compatibility with old tools not setting ifindex is
preserved.

Signed-off-by: Pavel Emelyanov &lt;xemul@parallels.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>
The ifinfomsg is in there (thanks kaber@ for foreseeing this long time ago),
so take the given ifidex and register netdev with it.

Ben noticed, that this code path previously ignored ifmp-&gt;ifi_index and
userland could be passing in garbage. Thus it may now fail occasionally
because the value clashes with an existing interface.

To address this it's assumed that if the caller specifies the ifindex for
the veth master device, then it's aware of this possibility and should
explicitly specify (or set to 0 for auto-assignment) the peer's ifindex as
well. With this the compatibility with old tools not setting ifindex is
preserved.

Signed-off-by: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2012-02-19T21:03:15+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-02-19T21:03:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=32efe08d77f5902ce7315fc9003c010ffffb8268'/>
<id>32efe08d77f5902ce7315fc9003c010ffffb8268</id>
<content type='text'>
Conflicts:
	drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c

Small minor conflict in bnx2x, wherein one commit changed how
statistics were stored in software, and another commit
fixed endianness bugs wrt. reading the values provided by
the chip in memory.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c

Small minor conflict in bnx2x, wherein one commit changed how
statistics were stored in software, and another commit
fixed endianness bugs wrt. reading the values provided by
the chip in memory.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: replace random_ether_addr() with eth_hw_addr_random()</title>
<updated>2012-02-15T20:34:16+00:00</updated>
<author>
<name>Danny Kukawka</name>
<email>danny.kukawka@bisect.de</email>
</author>
<published>2012-02-15T06:45:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f2cedb63df14342ad40a8b5b324fc5d94a60b665'/>
<id>f2cedb63df14342ad40a8b5b324fc5d94a60b665</id>
<content type='text'>
Replace usage of random_ether_addr() with eth_hw_addr_random()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Change the trivial cases.

v2: adapt to renamed eth_hw_addr_random()

Signed-off-by: Danny Kukawka &lt;danny.kukawka@bisect.de&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>
Replace usage of random_ether_addr() with eth_hw_addr_random()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Change the trivial cases.

v2: adapt to renamed eth_hw_addr_random()

Signed-off-by: Danny Kukawka &lt;danny.kukawka@bisect.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
