lkml.org 
[lkml]   [2015]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: skbuff: Fix checksum start check in skb_postpull_rcsum
From
Date
Yup, all better.  Thanks.

-Mike

On Thu, 2015-10-01 at 19:34 +0800, Herbert Xu wrote:
> In skb_postpull_rcsum the skb has already been pulled so we should
> be testing whether the checksum start offset is non-negative rather
> than how it compares to the length that we have pulled.
>
> Fixes: 6ae459bdaaee ("skbuff: Fix skb checksum flag on skb pull")
> Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index 2b0a30a..4398411 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -2708,7 +2708,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
> if (skb->ip_summed == CHECKSUM_COMPLETE)
> skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
> else if (skb->ip_summed == CHECKSUM_PARTIAL &&
> - skb_checksum_start_offset(skb) <= len)
> + skb_checksum_start_offset(skb) < 0)
> skb->ip_summed = CHECKSUM_NONE;
> }
>




\
 
 \ /
  Last update: 2015-10-01 14:01    [W:0.082 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site