<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/core/skbuff.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>2009-06-12T03:01:18Z</updated>
<entry>
<title>net: fix skb_seq_read returning wrong offset/length for page frag data</title>
<updated>2009-06-12T03:01:18Z</updated>
<author>
<name>Thomas Chenault</name>
</author>
<published>2009-05-19T04:43:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be139f75e2bdd069a9f2429339a042021e53159d'/>
<id>urn:sha1:be139f75e2bdd069a9f2429339a042021e53159d</id>
<content type='text'>
[ Upstream commit 995b337952cdf7e05d288eede580257b632a8343 ]

When called with a consumed value that is less than skb_headlen(skb)
bytes into a page frag, skb_seq_read() incorrectly returns an
offset/length relative to skb-&gt;data. Ensure that data which should come
from a page frag does.

Signed-off-by: Thomas Chenault &lt;thomas_chenault@dell.com&gt;
Tested-by: Shyam Iyer &lt;shyam_iyer@dell.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: Kill skb_truesize_check(), it only catches false-positives.</title>
<updated>2009-03-17T00:52:42Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2009-02-26T07:09:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=21ef40e66f6186898ea4240b83a0f1c7424953d0'/>
<id>urn:sha1:21ef40e66f6186898ea4240b83a0f1c7424953d0</id>
<content type='text'>
[ Upstream commit 92a0acce186cde8ead56c6915d9479773673ea1a ]

A long time ago we had bugs, primarily in TCP, where we would modify
skb-&gt;truesize (for TSO queue collapsing) in ways which would corrupt
the socket memory accounting.

skb_truesize_check() was added in order to try and catch this error
more systematically.

However this debugging check has morphed into a Frankenstein of sorts
and these days it does nothing other than catch false-positives.

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: Fix data corruption when splicing from sockets.</title>
<updated>2009-02-17T17:46:29Z</updated>
<author>
<name>Jarek Poplawski</name>
</author>
<published>2009-01-20T01:03:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa6872f58301c00e7e5bf075673b4b3b65dd151d'/>
<id>urn:sha1:fa6872f58301c00e7e5bf075673b4b3b65dd151d</id>
<content type='text'>
[ Upstream commit 8b9d3728977760f6bd1317c4420890f73695354e ]

The trick in socket splicing where we try to convert the skb-&gt;data
into a page based reference using virt_to_page() does not work so
well.

The idea is to pass the virt_to_page() reference via the pipe
buffer, and refcount the buffer using a SKB reference.

But if we are splicing from a socket to a socket (via sendpage)
this doesn't work.

The from side processing will grab the page (and SKB) references.
The sendpage() calls will grab page references only, return, and
then the from side processing completes and drops the SKB ref.

The page based reference to skb-&gt;data is not enough to keep the
kmalloc() buffer backing it from being reused.  Yet, that is
all that the socket send side has at this point.

This leads to data corruption if the skb-&gt;data buffer is reused
by SLAB before the send side socket actually gets the TX packet
out to the device.

The fix employed here is to simply allocate a page and copy the
skb-&gt;data bytes into that page.

This will hurt performance, but there is no clear way to fix this
properly without a copy at the present time, and it is important
to get rid of the data corruption.

With fixes from Herbert Xu.

Tested-by: Willy Tarreau &lt;w@1wt.eu&gt;
Foreseen-by: Changli Gao &lt;xiaosuo@gmail.com&gt;
Diagnosed-by: Willy Tarreau &lt;w@1wt.eu&gt;
Reported-by: Willy Tarreau &lt;w@1wt.eu&gt;
Fixed-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Signed-off-by: Jarek Poplawski &lt;jarkao2@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>net: Fix OOPS in skb_seq_read().</title>
<updated>2009-02-17T17:46:24Z</updated>
<author>
<name>Shyam Iyer</name>
</author>
<published>2009-01-30T00:12:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=42f1115b1be1f528a082b97b127e909d6f640079'/>
<id>urn:sha1:42f1115b1be1f528a082b97b127e909d6f640079</id>
<content type='text'>
[ Upstream commit 71b3346d182355f19509fadb8fe45114a35cc499 ]

It oopsd for me in skb_seq_read. addr2line said it was
linux-2.6/net/core/skbuff.c:2228, which is this line:

	while (st-&gt;frag_idx &lt; skb_shinfo(st-&gt;cur_skb)-&gt;nr_frags) {

I added some printks in there and it looks like we hit this:

        } else if (st-&gt;root_skb == st-&gt;cur_skb &amp;&amp;
                   skb_shinfo(st-&gt;root_skb)-&gt;frag_list) {
                 st-&gt;cur_skb = skb_shinfo(st-&gt;root_skb)-&gt;frag_list;
                 st-&gt;frag_idx = 0;
                 goto next_skb;
        }

Actually I did some testing and added a few printks and found that the
st-&gt;cur_skb-&gt;data was 0 and hence the ptr used by iscsi_tcp was null.
This caused the kernel panic.

 	if (abs_offset &lt; block_limit) {
-		*data = st-&gt;cur_skb-&gt;data + abs_offset;
+		*data = st-&gt;cur_skb-&gt;data + (abs_offset - st-&gt;stepped_offset);

I enabled the debug_tcp and with a few printks found that the code did
not go to the next_skb label and could find that the sequence being
followed was this -

It hit this if condition -

        if (st-&gt;cur_skb-&gt;next) {
                st-&gt;cur_skb = st-&gt;cur_skb-&gt;next;
                st-&gt;frag_idx = 0;
                goto next_skb;

And so, now the st pointer is shifted to the next skb whereas actually
it should have hit the second else if first since the data is in the
frag_list.

        else if (st-&gt;root_skb == st-&gt;cur_skb &amp;&amp;
                 skb_shinfo(st-&gt;root_skb)-&gt;frag_list) {
                st-&gt;cur_skb = skb_shinfo(st-&gt;root_skb)-&gt;frag_list;
                goto next_skb;
        }

Reversing the two conditions the attached patch fixes the issue for me
on top of Herbert's patches.

Signed-off-by: Shyam Iyer &lt;shyam_iyer@dell.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&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: Fix frag_list handling in skb_seq_read</title>
<updated>2009-02-17T17:46:24Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2009-01-30T00:07:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e9229c7efa9289d1179de4aab356c2738a49be2'/>
<id>urn:sha1:4e9229c7efa9289d1179de4aab356c2738a49be2</id>
<content type='text'>
[ Upstream commit 95e3b24cfb4ec0479d2c42f7a1780d68063a542a ]

The frag_list handling was broken in skb_seq_read:

1) We didn't add the stepped offset when looking at the head
are of fragments other than the first.

2) We didn't take the stepped offset away when setting the data
pointer in the head area.

3) The frag index wasn't reset.

This patch fixes both issues.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&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: Preserve netfilter attributes in skb_gso_segment using __copy_skb_header</title>
<updated>2008-08-16T02:51:36Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2008-08-15T21:55:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f85a124d819e1cf33b16d064a6a656fd448a735'/>
<id>urn:sha1:6f85a124d819e1cf33b16d064a6a656fd448a735</id>
<content type='text'>
skb_gso_segment didn't preserve some attributes in the original skb
such as the netfilter fields.  This was harmless until they were used
which is the case for packets going through lo.

This patch makes it call __copy_skb_header which also picks up some
other missing attributes.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mac80211: partially fix skb-&gt;cb use</title>
<updated>2008-07-29T20:55:08Z</updated>
<author>
<name>Johannes Berg</name>
</author>
<published>2008-07-29T09:32:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0f09804144fd9471a13cf4d80e66842c7fa114f'/>
<id>urn:sha1:d0f09804144fd9471a13cf4d80e66842c7fa114f</id>
<content type='text'>
This patch fixes mac80211 to not use the skb-&gt;cb over the queue step
from virtual interfaces to the master. The patch also, for now,
disables aggregation because that would still require requeuing,
will fix that in a separate patch. There are two other places (software
requeue and powersaving stations) where requeue can happen, but that is
not currently used by any drivers/not possible to use respectively.

Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&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>net: make __skb_splice_bits static</title>
<updated>2008-07-17T03:12:30Z</updated>
<author>
<name>Harvey Harrison</name>
</author>
<published>2008-07-17T03:12:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7b1c65faa27f5ade3915e4bbc9186b6e64d2d6ec'/>
<id>urn:sha1:7b1c65faa27f5ade3915e4bbc9186b6e64d2d6ec</id>
<content type='text'>
net/core/skbuff.c:1335:5: warning: symbol '__skb_splice_bits' was not declared. Should it be static?

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: refactor tcp splice receive path to improve readability</title>
<updated>2008-07-15T07:49:11Z</updated>
<author>
<name>Octavian Purdila</name>
</author>
<published>2008-07-15T07:49:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2870c43d1795bcb40b12bad6456f07ad8e64b3de'/>
<id>urn:sha1:2870c43d1795bcb40b12bad6456f07ad8e64b3de</id>
<content type='text'>
- move all of the details on offsets, lengths and buffers into a
single function instead of doing these operation from multiple places

- use a bottom up approach: try to avoid details in the high level
functions, introduce them gradually as we go deeper in the function
call stack

With helpful feedback from Jarek Poplawski.

Signed-off-by: Octavian Purdila &lt;opurdila@ixiacom.com&gt;
Acked-by: Jarek Poplawski &lt;jarkao2@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
