Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1237295

skbuff: Fix checksum start check in skb_postpull_rcsum

From Herbert Xu <herbert@gondor.apana.org.au>
Newsgroups linux.kernel
Subject skbuff: Fix checksum start check in skb_postpull_rcsum
Date 2015-10-01 13:40 +0200
Message-ID <qeKno-2Lo-11@gated-at.bofh.it> (permalink)
References <qeHIR-7lL-3@gated-at.bofh.it> <qeK42-2oH-15@gated-at.bofh.it> <qeKdI-2A1-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;
 }
 
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[regression] 6ae459bd skbuff: Fix skb checksum flag on skb pull Mike Galbraith <umgwanakikbuti@gmail.com> - 2015-10-01 10:00 +0200
  Re: [regression] 6ae459bd skbuff: Fix skb checksum flag on skb pull Herbert Xu <herbert@gondor.apana.org.au> - 2015-10-01 10:50 +0200
    Re: [regression] 6ae459bd skbuff: Fix skb checksum flag on skb pull Mike Galbraith <umgwanakikbuti@gmail.com> - 2015-10-01 13:20 +0200
      Re: [regression] 6ae459bd skbuff: Fix skb checksum flag on skb pull Herbert Xu <herbert@gondor.apana.org.au> - 2015-10-01 13:30 +0200
        skbuff: Fix checksum start check in skb_postpull_rcsum Herbert Xu <herbert@gondor.apana.org.au> - 2015-10-01 13:40 +0200
          Re: skbuff: Fix checksum start check in skb_postpull_rcsum Mike Galbraith <umgwanakikbuti@gmail.com> - 2015-10-01 13:50 +0200
          Re: skbuff: Fix checksum start check in skb_postpull_rcsum David Miller <davem@davemloft.net> - 2015-10-01 17:10 +0200
            Re: skbuff: Fix checksum start check in skb_postpull_rcsum Herbert Xu <herbert@gondor.apana.org.au> - 2015-10-01 17:20 +0200
  Re: [regression] 6ae459bd skbuff: Fix skb checksum flag on skb pull Yanko Kaneti <yaneti@declera.com> - 2015-10-01 13:00 +0200

csiph-web