Skip to content

Commit

Permalink
netfilter: ipv6: fix overlap check for fragments
Browse files Browse the repository at this point in the history
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 <shanwei@cn.fujitsu.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Shan Wei authored and Patrick McHardy committed Nov 12, 2010
1 parent ac5aa2e commit 22e091e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/nf_conntrack_reasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,

/* Check for overlap with preceding fragment. */
if (prev &&
(NFCT_FRAG6_CB(prev)->offset + prev->len) - offset > 0)
(NFCT_FRAG6_CB(prev)->offset + prev->len) > offset)
goto discard_fq;

/* Look for overlap with succeeding segment. */
Expand Down

0 comments on commit 22e091e

Please sign in to comment.