From: Thomas Chenault Date: Tue, 19 May 2009 04:43:27 +0000 (-0700) Subject: net: fix skb_seq_read returning wrong offset/length for page frag data X-Git-Tag: v2.6.29.5~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7a6c1b0a5d74c37ada244880779750eda1a370e;p=thirdparty%2Fkernel%2Fstable.git net: fix skb_seq_read returning wrong offset/length for page frag data [ 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 Tested-by: Shyam Iyer Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/skbuff.c b/net/core/skbuff.c index eae69549ccb9f..f4bbc98e5e077 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -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; }