From: Shan Wei Date: Fri, 5 Nov 2010 01:56:34 +0000 (+0000) Subject: ipv6: fix overlap check for fragments X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f46421416fb6b91513fb687d6503142cd99034a5;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ipv6: fix overlap check for fragments The type of FRAG6_CB(prev)->offset is int, skb->len is *unsigned* int, and offset is int. Without this patch, type conversion occurred to this expression, when (FRAG6_CB(prev)->offset + prev->len) is less than offset. Signed-off-by: Shan Wei Signed-off-by: David S. Miller --- diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index c7ba3149633f..0f2766453759 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -349,7 +349,7 @@ found: /* Check for overlap with preceding fragment. */ if (prev && - (FRAG6_CB(prev)->offset + prev->len) - offset > 0) + (FRAG6_CB(prev)->offset + prev->len) > offset) goto discard_fq; /* Look for overlap with succeeding segment. */