Skip to content
Snippets Groups Projects
Commit 22e091e5 authored by Shan Wei's avatar Shan Wei Committed by Patrick McHardy
Browse files

netfilter: 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: default avatarShan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent ac5aa2e3
No related branches found
No related tags found
No related merge requests found
...@@ -286,7 +286,7 @@ found: ...@@ -286,7 +286,7 @@ found:
/* Check for overlap with preceding fragment. */ /* Check for overlap with preceding fragment. */
if (prev && if (prev &&
(NFCT_FRAG6_CB(prev)->offset + prev->len) - offset > 0) (NFCT_FRAG6_CB(prev)->offset + prev->len) > offset)
goto discard_fq; goto discard_fq;
/* Look for overlap with succeeding segment. */ /* Look for overlap with succeeding segment. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment