<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/ipv4/tcp.c, branch linux-2.6.27.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.27.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.27.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-04-30T14:53:40Z</updated>
<entry>
<title>net: Fix oops from tcp_collapse() when using splice()</title>
<updated>2011-04-30T14:53:40Z</updated>
<author>
<name>Steven J. Magnani</name>
</author>
<published>2010-03-30T20:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=36493e838ff016f2cd54353e81e9213d95c5022f'/>
<id>urn:sha1:36493e838ff016f2cd54353e81e9213d95c5022f</id>
<content type='text'>
commit baff42ab1494528907bf4d5870359e31711746ae upstream.

tcp_read_sock() can have a eat skbs without immediately advancing copied_seq.
This can cause a panic in tcp_collapse() if it is called as a result
of the recv_actor dropping the socket lock.

A userspace program that splices data from a socket to either another
socket or to a file can trigger this bug.

Signed-off-by: Steven J. Magnani &lt;steve@digidescorp.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

</content>
</entry>
<entry>
<title>tcp: Make TCP_MAXSEG minimum more correct.</title>
<updated>2011-04-30T14:53:05Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2010-11-24T19:47:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12d61bf8bfddc02aff9a7136806e07075b0ecfea'/>
<id>urn:sha1:12d61bf8bfddc02aff9a7136806e07075b0ecfea</id>
<content type='text'>
commit c39508d6f118308355468314ff414644115a07f3 upstream.

Use TCP_MIN_MSS instead of constant 64.

Reported-by: Min Zhang &lt;mzhang@mvista.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Moritz Muehlenhoff &lt;jmm@debian.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>tcp: Increase TCP_MAXSEG socket option minimum.</title>
<updated>2011-04-30T14:53:05Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2010-11-11T05:35:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a0d7e098d148e648f72b2dff5173170b59a41aa0'/>
<id>urn:sha1:a0d7e098d148e648f72b2dff5173170b59a41aa0</id>
<content type='text'>
commit 7a1abd08d52fdeddb3e9a5a33f2f15cc6a5674d2 upstream.

As noted by Steve Chen, since commit
f5fff5dc8a7a3f395b0525c02ba92c95d42b7390 ("tcp: advertise MSS
requested by user") we can end up with a situation where
tcp_select_initial_window() does a divide by a zero (or
even negative) mss value.

The problem is that sometimes we effectively subtract
TCPOLEN_TSTAMP_ALIGNED and/or TCPOLEN_MD5SIG_ALIGNED from the mss.

Fix this by increasing the minimum from 8 to 64.

Reported-by: Steve Chen &lt;schen@mvista.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Moritz Muehlenhoff &lt;jmm@debian.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>tcp: Fix race in tcp_poll</title>
<updated>2010-12-09T21:24:20Z</updated>
<author>
<name>Tom Marshall</name>
</author>
<published>2010-09-20T22:42:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f55602fe53731957890c6af874c40f5b0c07a387'/>
<id>urn:sha1:f55602fe53731957890c6af874c40f5b0c07a387</id>
<content type='text'>
[ Upstream commit a4d258036ed9b2a1811c3670c6099203a0f284a0 ]

If a RST comes in immediately after checking sk-&gt;sk_err, tcp_poll will
return POLLIN but not POLLOUT.  Fix this by checking sk-&gt;sk_err at the end
of tcp_poll.  Additionally, ensure the correct order of operations on SMP
machines with memory barriers.

Signed-off-by: Tom Marshall &lt;tdm.code@gmail.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&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>Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.</title>
<updated>2010-12-09T21:24:20Z</updated>
<author>
<name>Robin Holt</name>
</author>
<published>2010-10-20T02:03:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8fe45abc8d6f871411f8305d82bb999926629afb'/>
<id>urn:sha1:8fe45abc8d6f871411f8305d82bb999926629afb</id>
<content type='text'>
[ Upstream fixed this in a different way as parts of the commits:
	8d987e5c7510 (net: avoid limits overflow)
	a9febbb4bd13 (sysctl: min/max bounds are optional)
	27b3d80a7b6a (sysctl: fix min/max handling in __do_proc_doulongvec_minmax())
 -DaveM ]
 
On a 16TB x86_64 machine, sysctl_tcp_mem[2], sysctl_udp_mem[2], and
sysctl_sctp_mem[2] can integer overflow.  Set limit such that they are
maximized without overflowing.

Signed-off-by: Robin Holt &lt;holt@sgi.com&gt;
To: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Willy Tarreau &lt;w@1wt.eu&gt;
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-sctp@vger.kernel.org
Cc: Alexey Kuznetsov &lt;kuznet@ms2.inr.ac.ru&gt;
Cc: "Pekka Savola (ipv6)" &lt;pekkas@netcore.fi&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Hideaki YOSHIFUJI &lt;yoshfuji@linux-ipv6.org&gt;
Cc: Patrick McHardy &lt;kaber@trash.net&gt;
Cc: Vlad Yasevich &lt;vladislav.yasevich@hp.com&gt;
Cc: Sridhar Samudrala &lt;sri@us.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>tcp: Fix length tcp_splice_data_recv passes to skb_splice_bits.</title>
<updated>2009-02-17T17:46:25Z</updated>
<author>
<name>Dimitris Michailidis</name>
</author>
<published>2009-01-27T06:15:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7f0899f997d1ebccf5658bf845fb3a6e1d9dea88'/>
<id>urn:sha1:7f0899f997d1ebccf5658bf845fb3a6e1d9dea88</id>
<content type='text'>
[ Upstream commit 9fa5fdf291c9b58b1cb8b4bb2a0ee57efa21d635 ]

tcp_splice_data_recv has two lengths to consider: the len parameter it
gets from tcp_read_sock, which specifies the amount of data in the skb,
and rd_desc-&gt;count, which is the amount of data the splice caller still
wants.  Currently it passes just the latter to skb_splice_bits, which then
splices min(rd_desc-&gt;count, skb-&gt;len - offset) bytes.

Most of the time this is fine, except when the skb contains urgent data.
In that case len goes only up to the urgent byte and is less than
skb-&gt;len - offset.  By ignoring len tcp_splice_data_recv may a) splice
data tcp_read_sock told it not to, b) return to tcp_read_sock a value &gt; len.

Now, tcp_read_sock doesn't handle used &gt; len and leaves the socket in a
bad state (both sk_receive_queue and copied_seq are bad at that point)
resulting in duplicated data and corruption.

Fix by passing min(rd_desc-&gt;count, len) to skb_splice_bits.

Signed-off-by: Dimitris Michailidis &lt;dm@chelsio.com&gt;
Acked-by: Eric Dumazet &lt;dada1@cosmosbay.com&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>tcp: splice as many packets as possible at once</title>
<updated>2009-02-17T17:46:25Z</updated>
<author>
<name>Willy Tarreau</name>
</author>
<published>2009-01-14T00:04:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5ff7f311055a967350fa376601f8e20440bbcf4'/>
<id>urn:sha1:f5ff7f311055a967350fa376601f8e20440bbcf4</id>
<content type='text'>
[ Upstream commit 33966dd0e2f68f26943cd9ee93ec6abbc6547a8e ]

As spotted by Willy Tarreau, current splice() from tcp socket to pipe is not
optimal. It processes at most one segment per call.
This results in low performance and very high overhead due to syscall rate
when splicing from interfaces which do not support LRO.

Willy provided a patch inside tcp_splice_read(), but a better fix
is to let tcp_read_sock() process as many segments as possible, so
that tcp_rcv_space_adjust() and tcp_cleanup_rbuf() are called less
often.

With this change, splice() behaves like tcp_recvmsg(), being able
to consume many skbs in one system call. With typical 1460 bytes
of payload per frame, that means splice(SPLICE_F_NONBLOCK) can return
16*1460 = 23360 bytes.

Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Eric Dumazet &lt;dada1@cosmosbay.com&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>tcp: don't mask EOF and socket errors on nonblocking splice receive</title>
<updated>2009-01-25T00:36:19Z</updated>
<author>
<name>Lennert Buytenhek</name>
</author>
<published>2009-01-20T23:25:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2552605f3b34253754c05ffd84a585514eecc62'/>
<id>urn:sha1:d2552605f3b34253754c05ffd84a585514eecc62</id>
<content type='text'>
[ Upstream commit: 4f7d54f59bc470f0aaa932f747a95232d7ebf8b1 ]

Currently, setting SPLICE_F_NONBLOCK on splice from a TCP socket
results in masking of EOF (RDHUP) and error conditions on the socket
by an -EAGAIN return.  Move the NONBLOCK check in tcp_splice_read()
to be after the EOF and error checks to fix this.

Signed-off-by: Lennert Buytenhek &lt;buytenh@marvell.com&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: convert BUG_TRAP to generic WARN_ON</title>
<updated>2008-07-26T04:43:18Z</updated>
<author>
<name>Ilpo Järvinen</name>
</author>
<published>2008-07-26T04:43:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=547b792cac0a038b9dbf958d3c120df3740b5572'/>
<id>urn:sha1:547b792cac0a038b9dbf958d3c120df3740b5572</id>
<content type='text'>
Removes legacy reinvent-the-wheel type thing. The generic
machinery integrates much better to automated debugging aids
such as kerneloops.org (and others), and is unambiguous due to
better naming. Non-intuively BUG_TRAP() is actually equal to
WARN_ON() rather than BUG_ON() though some might actually be
promoted to BUG_ON() but I left that to future.

I could make at least one BUILD_BUG_ON conversion.

Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@helsinki.fi&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: Fix MD5 signatures for non-linear skbs</title>
<updated>2008-07-19T07:01:42Z</updated>
<author>
<name>Adam Langley</name>
</author>
<published>2008-07-19T07:01:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=49a72dfb8814c2d65bd9f8c9c6daf6395a1ec58d'/>
<id>urn:sha1:49a72dfb8814c2d65bd9f8c9c6daf6395a1ec58d</id>
<content type='text'>
Currently, the MD5 code assumes that the SKBs are linear and, in the case
that they aren't, happily goes off and hashes off the end of the SKB and
into random memory.

Reported by Stephen Hemminger in [1]. Advice thanks to Stephen and Evgeniy
Polyakov. Also includes a couple of missed route_caps from Stephen's patch
in [2].

[1] http://marc.info/?l=linux-netdev&amp;m=121445989106145&amp;w=2
[2] http://marc.info/?l=linux-netdev&amp;m=121459157816964&amp;w=2

Signed-off-by: Adam Langley &lt;agl@imperialviolet.org&gt;
Acked-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
