<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/macvlan.c, branch v3.0.79</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/net/macvlan.c?h=v3.0.79</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/net/macvlan.c?h=v3.0.79'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-05-19T17:04:46Z</updated>
<entry>
<title>macvlan: fix passthru mode race between dev removal and rx path</title>
<updated>2013-05-19T17:04:46Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2013-05-09T04:23:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d5bf240fa193989d605a715bda7cb3283b1abc89'/>
<id>urn:sha1:d5bf240fa193989d605a715bda7cb3283b1abc89</id>
<content type='text'>
[ Upstream commit 233c7df0821c4190e2d3f4be0f2ca0ab40a5ed8c, note
  that I had to add list_first_or_null_rcu to rculist.h in order
  to accomodate this fix. ]

Currently, if macvlan in passthru mode is created and data are rxed and
you remove this device, following panic happens:

NULL pointer dereference at 0000000000000198
IP: [&lt;ffffffffa0196058&gt;] macvlan_handle_frame+0x153/0x1f7 [macvlan]

I'm using following script to trigger this:
&lt;script&gt;
while [ 1 ]
do
	ip link add link e1 name macvtap0 type macvtap mode passthru
	ip link set e1 up
	ip link set macvtap0 up
	IFINDEX=`ip link |grep macvtap0 | cut -f 1 -d ':'`
	cat /dev/tap$IFINDEX  &gt;/dev/null &amp;
	ip link del dev macvtap0
done
&lt;/script&gt;

I run this script while "ping -f" is running on another machine to send
packets to e1 rx.

Reason of the panic is that list_first_entry() is blindly called in
macvlan_handle_frame() even if the list was empty. vlan is set to
incorrect pointer which leads to the crash.

I'm fixing this by protecting port-&gt;vlans list by rcu and by preventing
from getting incorrect pointer in case the list is empty.

Introduced by: commit eb06acdc85585f2 "macvlan: Introduce 'passthru' mode to takeover the underlying device"

Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.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>
</entry>
<entry>
<title>Revert "net: maintain namespace isolation between vlan and real device"</title>
<updated>2012-06-09T15:33:03Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-05-11T03:03:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=83bba7979059b83df4edc16f747784c6990fc3bb'/>
<id>urn:sha1:83bba7979059b83df4edc16f747784c6990fc3bb</id>
<content type='text'>
[ Upstream commit 59b9997baba5242997ddc7bd96b1391f5275a5a4 ]

This reverts commit 8a83a00b0735190384a348156837918271034144.

It causes regressions for S390 devices, because it does an
unconditional DST drop on SKBs for vlans and the QETH device
needs the neighbour entry hung off the DST for certain things
on transmit.

Arnd can't remember exactly why he even needed this change.

Conflicts:

	drivers/net/macvlan.c
	net/8021q/vlan_dev.c
	net/core/dev.c

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>macvlan/macvtap: Fix unicast between macvtap interfaces in bridge mode</title>
<updated>2011-11-11T17:36:26Z</updated>
<author>
<name>David Ward</name>
<email>david.ward@ll.mit.edu</email>
</author>
<published>2011-09-18T12:53:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=89c32c14c190c6113187c7c57784695701e314e4'/>
<id>urn:sha1:89c32c14c190c6113187c7c57784695701e314e4</id>
<content type='text'>
[ Upstream commit cb2d0f3e968bff7c6d262aca3e3ab8d4184e69b2 ]

Packets should always be forwarded to the lowerdev using dev_forward_skb.
vlan-&gt;forward is for packets being forwarded directly to another macvlan/
macvtap device (used for multicast in bridge mode).

Reported-and-tested-by: Shlomo Pongratz &lt;shlomop@mellanox.com&gt;
Signed-off-by: David Ward &lt;david.ward@ll.mit.edu&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared</title>
<updated>2011-08-16T01:31:38Z</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2011-07-26T06:05:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9cf81e790a0d8709cbadbaff73ee40aa944e2ea1'/>
<id>urn:sha1:9cf81e790a0d8709cbadbaff73ee40aa944e2ea1</id>
<content type='text'>
[ Upstream commit 550fd08c2cebad61c548def135f67aba284c6162 ]

After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs.  There are a handful of drivers that violate this assumption of
course, and need to be fixed up.  This patch identifies those drivers, and marks
them as not being able to support the safe transmission of skbs by clearning the
IFF_TX_SKB_SHARING flag in priv_flags

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
CC: Karsten Keil &lt;isdn@linux-pingi.de&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
CC: Jay Vosburgh &lt;fubar@us.ibm.com&gt;
CC: Andy Gospodarek &lt;andy@greyhouse.net&gt;
CC: Patrick McHardy &lt;kaber@trash.net&gt;
CC: Krzysztof Halasa &lt;khc@pm.waw.pl&gt;
CC: "John W. Linville" &lt;linville@tuxdriver.com&gt;
CC: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
CC: Marcel Holtmann &lt;marcel@holtmann.org&gt;
CC: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>macvlan: Forward unicast frames in bridge mode to lowerdev</title>
<updated>2011-05-23T01:01:18Z</updated>
<author>
<name>David Ward</name>
<email>david.ward@ll.mit.edu</email>
</author>
<published>2011-05-19T02:53:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a37dd3332319260cce81ac91ce25fcc3a31de997'/>
<id>urn:sha1:a37dd3332319260cce81ac91ce25fcc3a31de997</id>
<content type='text'>
Unicast frames between macvlan interfaces in bridge mode are not otherwise
sent to network taps on the lowerdev (as all other macvlan frames are), so
forward the frames to the receive queue of the lowerdev first.

Signed-off-by: David Ward &lt;david.ward@ll.mit.edu&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6</title>
<updated>2011-05-20T20:43:21Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-05-20T20:43:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=06f4e926d256d902dd9a53dcb400fd74974ce087'/>
<id>urn:sha1:06f4e926d256d902dd9a53dcb400fd74974ce087</id>
<content type='text'>
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1446 commits)
  macvlan: fix panic if lowerdev in a bond
  tg3: Add braces around 5906 workaround.
  tg3: Fix NETIF_F_LOOPBACK error
  macvlan: remove one synchronize_rcu() call
  networking: NET_CLS_ROUTE4 depends on INET
  irda: Fix error propagation in ircomm_lmp_connect_response()
  irda: Kill set but unused variable 'bytes' in irlan_check_command_param()
  irda: Kill set but unused variable 'clen' in ircomm_connect_indication()
  rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()
  be2net: Kill set but unused variable 'req' in lancer_fw_download()
  irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()
  atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.
  rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
  rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()
  rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()
  rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()
  pkt_sched: Kill set but unused variable 'protocol' in tc_classify()
  isdn: capi: Use pr_debug() instead of ifdefs.
  tg3: Update version to 3.119
  tg3: Apply rx_discards fix to 5719/5720
  ...

Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c
as per Davem.
</content>
</entry>
<entry>
<title>macvlan: fix panic if lowerdev in a bond</title>
<updated>2011-05-20T18:59:23Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-05-20T18:59:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d93515611bbc70c2fe4db232e5feb448ed8e4cc9'/>
<id>urn:sha1:d93515611bbc70c2fe4db232e5feb448ed8e4cc9</id>
<content type='text'>
commit a35e2c1b6d905 (macvlan: use rx_handler_data pointer to store
macvlan_port pointer V2) added a bug in macvlan_port_create()

Steps to reproduce the bug:

# ifenslave bond0 eth0 eth1

# ip link add link eth0 up name eth0#1 type macvlan
-&gt;error EBUSY

# ip link add link eth0 up name eth0#1 type macvlan
-&gt;panic


Fix: Dont set IFF_MACVLAN_PORT in error case.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>macvlan: remove one synchronize_rcu() call</title>
<updated>2011-05-20T04:33:18Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-05-19T12:24:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=449f4544267e73d5db372971da63634707c32299'/>
<id>urn:sha1:449f4544267e73d5db372971da63634707c32299</id>
<content type='text'>
When one macvlan device is dismantled, we can avoid one
synchronize_rcu() call done after deletion from hash list, since caller
will perform a synchronize_net() call after its ndo_stop() call.

Add a new netdev-&gt;dismantle field to signal this dismantle intent.

Reduces RTNL hold time.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Patrick McHardy &lt;kaber@trash.net&gt;
CC: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: use batched device unregister in veth and macvlan</title>
<updated>2011-05-09T18:41:40Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-05-08T23:17:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=226bd3411471af42f7edbdfaf73f2d54ebb62a66'/>
<id>urn:sha1:226bd3411471af42f7edbdfaf73f2d54ebb62a66</id>
<content type='text'>
veth devices dont use the batched device unregisters yet.

Since veth are a pair of devices, it makes sense to use a batch of two
unregisters, this roughly divides dismantle time by two.

Fix this by changing dellink() callers to always provide a non NULL
head. (Idea from Michał Mirosław)

This patch also handles macvlan case : We now dismantle all macvlans on
top of a lower dev at once.

Reported-by: Alex Bligh &lt;alex@alex.org.uk&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Michał Mirosław &lt;mirqus@gmail.com&gt;
Cc: Jesse Gross &lt;jesse@nicira.com&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>macvlan,rcu: convert call_rcu(macvlan_port_rcu_free) to kfree_rcu()</title>
<updated>2011-05-08T05:51:01Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2011-03-18T04:00:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6e070aecd9e304264a6b8655f49aa7e6db0e55f2'/>
<id>urn:sha1:6e070aecd9e304264a6b8655f49aa7e6db0e55f2</id>
<content type='text'>
The rcu callback macvlan_port_rcu_free() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(macvlan_port_rcu_free).

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
</content>
</entry>
</feed>
