<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/loopback.c, branch v3.12.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/net/loopback.c?h=v3.12.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/net/loopback.c?h=v3.12.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-09-17T23:05:13Z</updated>
<entry>
<title>net loopback: Set loopback_dev to NULL when freed</title>
<updated>2013-09-17T23:05:13Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2013-09-16T23:52:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e05e90702b2638a39b5ae9d22740f3a1607c54a0'/>
<id>urn:sha1:e05e90702b2638a39b5ae9d22740f3a1607c54a0</id>
<content type='text'>
It has recently turned up that we have a number of long standing bugs
in the network stack cleanup code with use of the loopback device
after it has been freed that have not turned up because in most cases
the storage allocated to the loopback device is not reused, when those
accesses happen.

Set looback_dev to NULL to trigger oopses instead of silent data corrupt
when we hit this class of bug.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: loopback: fix a dst refcounting issue</title>
<updated>2013-01-27T06:30:35Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-01-25T07:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=794ed393b707f01858f5ebe2ae5eabaf89d00022'/>
<id>urn:sha1:794ed393b707f01858f5ebe2ae5eabaf89d00022</id>
<content type='text'>
Ben Greear reported crashes in ip_rcv_finish() on a stress
test involving many macvlans.

We tracked the bug to a dst use after free. ip_rcv_finish()
was calling dst-&gt;input() and got garbage for dst-&gt;input value.

It appears the bug is in loopback driver, lacking
a skb_dst_force() before calling netif_rx().

As a result, a non refcounted dst, normally protected by a
RCU read_lock section, was escaping this section and could
be freed before the packet being processed.

  [&lt;ffffffff813a3c4d&gt;] loopback_xmit+0x64/0x83
  [&lt;ffffffff81477364&gt;] dev_hard_start_xmit+0x26c/0x35e
  [&lt;ffffffff8147771a&gt;] dev_queue_xmit+0x2c4/0x37c
  [&lt;ffffffff81477456&gt;] ? dev_hard_start_xmit+0x35e/0x35e
  [&lt;ffffffff8148cfa6&gt;] ? eth_header+0x28/0xb6
  [&lt;ffffffff81480f09&gt;] neigh_resolve_output+0x176/0x1a7
  [&lt;ffffffff814ad835&gt;] ip_finish_output2+0x297/0x30d
  [&lt;ffffffff814ad6d5&gt;] ? ip_finish_output2+0x137/0x30d
  [&lt;ffffffff814ad90e&gt;] ip_finish_output+0x63/0x68
  [&lt;ffffffff814ae412&gt;] ip_output+0x61/0x67
  [&lt;ffffffff814ab904&gt;] dst_output+0x17/0x1b
  [&lt;ffffffff814adb6d&gt;] ip_local_out+0x1e/0x23
  [&lt;ffffffff814ae1c4&gt;] ip_queue_xmit+0x315/0x353
  [&lt;ffffffff814adeaf&gt;] ? ip_send_unicast_reply+0x2cc/0x2cc
  [&lt;ffffffff814c018f&gt;] tcp_transmit_skb+0x7ca/0x80b
  [&lt;ffffffff814c3571&gt;] tcp_connect+0x53c/0x587
  [&lt;ffffffff810c2f0c&gt;] ? getnstimeofday+0x44/0x7d
  [&lt;ffffffff810c2f56&gt;] ? ktime_get_real+0x11/0x3e
  [&lt;ffffffff814c6f9b&gt;] tcp_v4_connect+0x3c2/0x431
  [&lt;ffffffff814d6913&gt;] __inet_stream_connect+0x84/0x287
  [&lt;ffffffff814d6b38&gt;] ? inet_stream_connect+0x22/0x49
  [&lt;ffffffff8108d695&gt;] ? _local_bh_enable_ip+0x84/0x9f
  [&lt;ffffffff8108d6c8&gt;] ? local_bh_enable+0xd/0x11
  [&lt;ffffffff8146763c&gt;] ? lock_sock_nested+0x6e/0x79
  [&lt;ffffffff814d6b38&gt;] ? inet_stream_connect+0x22/0x49
  [&lt;ffffffff814d6b49&gt;] inet_stream_connect+0x33/0x49
  [&lt;ffffffff814632c6&gt;] sys_connect+0x75/0x98

This bug was introduced in linux-2.6.35, in commit
7fee226ad2397b (net: add a noref bit on skb dst)

skb_dst_force() is enforced in dev_queue_xmit() for devices having a
qdisc.

Reported-by: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Tested-by: Ben Greear &lt;greearb@candelatech.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: loopback: set default mtu to 64K</title>
<updated>2012-09-24T20:23:53Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2012-09-23T22:28:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0cf833aefaa85bbfce3ff70485e5534e09254773'/>
<id>urn:sha1:0cf833aefaa85bbfce3ff70485e5534e09254773</id>
<content type='text'>
loopback current mtu of 16436 bytes allows no more than 3 MSS TCP
segments per frame, or 48 Kbytes. Changing mtu to 64K allows TCP
stack to build large frames and significantly reduces stack overhead.

Performance boost on bulk TCP transferts can be up to 30 %, partly
because we now have one ACK message for two 64KB segments, and a lower
probability of hitting /proc/sys/net/ipv4/tcp_reordering default limit.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Loopback ifindex is constant now</title>
<updated>2012-08-09T23:18:07Z</updated>
<author>
<name>Pavel Emelyanov</name>
<email>xemul@parallels.com</email>
</author>
<published>2012-08-08T21:53:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1fb9489bf190ce2b3fc03891f3de4b2d30600e28'/>
<id>urn:sha1:1fb9489bf190ce2b3fc03891f3de4b2d30600e28</id>
<content type='text'>
As pointed out, there are places, that access net-&gt;loopback_dev-&gt;ifindex
and after ifindex generation is made per-net this value becomes constant
equals 1. So go ahead and introduce the LOOPBACK_IFINDEX constant and use
it where appropriate.

Signed-off-by: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: fix race condition in several drivers when reading stats</title>
<updated>2012-07-22T19:12:32Z</updated>
<author>
<name>Kevin Groeneveld</name>
<email>kgroeneveld@gmail.com</email>
</author>
<published>2012-07-21T06:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e3906486f616da7cc086a3ba06c0df4e5a48b4ab'/>
<id>urn:sha1:e3906486f616da7cc086a3ba06c0df4e5a48b4ab</id>
<content type='text'>
Fix race condition in several network drivers when reading stats on 32bit
UP architectures.  These drivers update their stats in a BH context and
therefore should use u64_stats_fetch_begin_bh/u64_stats_fetch_retry_bh
instead of u64_stats_fetch_begin/u64_stats_fetch_retry when reading the
stats.

Signed-off-by: Kevin Groeneveld &lt;kgroeneveld@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Remove all #inclusions of asm/system.h</title>
<updated>2012-03-28T17:30:03Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2012-03-28T17:30:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9ffc93f203c18a70623f21950f1dd473c9ec48cd'/>
<id>urn:sha1:9ffc93f203c18a70623f21950f1dd473c9ec48cd</id>
<content type='text'>
Remove all #inclusions of asm/system.h preparatory to splitting and killing
it.  Performed with the following command:

perl -p -i -e 's!^#\s*include\s*&lt;asm/system[.]h&gt;.*\n!!' `grep -Irl '^#\s*include\s*&lt;asm/system[.]h&gt;' *`

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
<entry>
<title>net: remove NETIF_F_NO_CSUM feature bit</title>
<updated>2011-11-16T22:43:12Z</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2011-11-15T15:29:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=34324dc2bf27c1773045fea63cb11f7e2a6ad2b9'/>
<id>urn:sha1:34324dc2bf27c1773045fea63cb11f7e2a6ad2b9</id>
<content type='text'>
Only distinct use is checking if NETIF_F_NOCACHE_COPY should be
enabled by default. The check heuristics is altered a bit here,
so it hits other people than before. The default shouldn't be
trusted for performance-critical cases anyway.

For all other uses NETIF_F_NO_CSUM is equivalent to NETIF_F_HW_CSUM.

Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: Allow ethtool to set interface in loopback mode.</title>
<updated>2011-05-08T22:59:12Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2011-05-04T15:30:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=eed2a12f1ed9aabf0676f4d0db34aad51976c5c6'/>
<id>urn:sha1:eed2a12f1ed9aabf0676f4d0db34aad51976c5c6</id>
<content type='text'>
This patch enables ethtool to set the loopback mode on a given interface.
By configuring the interface in loopback mode in conjunction with a policy
route / rule, a userland application can stress the egress / ingress path
exposing the flows of the change in progress and potentially help developer(s)
understand the impact of those changes without even sending a packet out
on the network.

Following set of commands illustrates one such example -
    a) ip -4 addr add 192.168.1.1/24 dev eth1
    b) ip -4 rule add from all iif eth1 lookup 250
    c) ip -4 route add local 0/0 dev lo proto kernel scope host table 250
    d) arp -Ds 192.168.1.100 eth1
    e) arp -Ds 192.168.1.200 eth1
    f) sysctl -w net.ipv4.ip_nonlocal_bind=1
    g) sysctl -w net.ipv4.conf.all.accept_local=1
    # Assuming that the machine has 8 cores
    h) taskset 000f netserver -L 192.168.1.200
    i) taskset 00f0 netperf -t TCP_CRR -L 192.168.1.100 -H 192.168.1.200 -l 30

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Acked-by: Ben Hutchings &lt;bhutchings@solarflare.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ip6_pol_route panic: Do not allow VLAN on loopback</title>
<updated>2011-04-18T06:27:16Z</updated>
<author>
<name>Krishna Kumar</name>
<email>krkumar2@in.ibm.com</email>
</author>
<published>2011-04-14T06:07:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0553c891fabd287726b41076cfd03fe7e5ab596f'/>
<id>urn:sha1:0553c891fabd287726b41076cfd03fe7e5ab596f</id>
<content type='text'>
Several tests in the ipv6 routing code check IFF_LOOPBACK, and
allowing stacking such as VLAN'ing on top of loopback results in a
netdevice which reports IFF_LOOPBACK but really isn't the loopback
device.

Instead of spamming the ipv6 routing code with even more special tests,
simply disallow VLAN over loopback.

The result of this patch is:

# modprobe 8021q
# vconfig add lo 43
ERROR: trying to add VLAN #43 to IF -:lo:-  error: Operation not supported

Signed-off-by: Krishna Kumar &lt;krkumar2@in.ibm.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>loopback: convert to hw_features</title>
<updated>2011-02-17T22:16:35Z</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2011-02-15T16:59:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cf0bdefd4676ad4ad59507a058821491a40ec7e6'/>
<id>urn:sha1:cf0bdefd4676ad4ad59507a058821491a40ec7e6</id>
<content type='text'>
This also enables TSOv6, TSO-ECN, and UFO as loopback clearly can handle them.

Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
