]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net: fix skb_seq_read returning wrong offset/length for page frag data
authorThomas Chenault <thomas_chenault@dell.com>
Tue, 19 May 2009 04:43:27 +0000 (21:43 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:39:50 +0000 (09:39 -0700)
[ 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->data. Ensure that data which should come
from a page frag does.

Signed-off-by: Thomas Chenault <thomas_chenault@dell.com>
Tested-by: Shyam Iyer <shyam_iyer@dell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/core/skbuff.c

index eae69549ccb9fa9c5b039a315147a67f9fa78a69..f4bbc98e5e077ec2074a9a2428eaafe46a63a4e4 100644 (file)
@@ -2206,7 +2206,7 @@ unsigned int skb_seq_read(unsigned int consumed, const u8 **data,
 next_skb:
        block_limit = skb_headlen(st->cur_skb) + st->stepped_offset;
 
-       if (abs_offset < block_limit) {
+       if (abs_offset < block_limit && !st->frag_data) {
                *data = st->cur_skb->data + (abs_offset - st->stepped_offset);
                return block_limit - abs_offset;
        }