Commit dc489ad6 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Fix "net: ipv4: do not handle duplicate fragments as overlapping"

ade44640 ("net: ipv4: do not handle duplicate fragments as
overlapping") was backported to many stable trees, but it had a problem
that was "accidentally" fixed by the upstream commit 0ff89efb ("ip:
fail fast on IP defrag errors")

This is the fixup for that problem as we do not want the larger patch in
the older stable trees.

Fixes: ade44640 ("net: ipv4: do not handle duplicate fragments as overlapping")
Reported-by: default avatarIvan Babrou <ivan@cloudflare.com>
Reported-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e1e364bf
...@@ -425,6 +425,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) ...@@ -425,6 +425,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
* fragment. * fragment.
*/ */
err = -EINVAL;
/* Find out where to put this fragment. */ /* Find out where to put this fragment. */
prev_tail = qp->q.fragments_tail; prev_tail = qp->q.fragments_tail;
if (!prev_tail) if (!prev_tail)
...@@ -501,7 +502,6 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) ...@@ -501,7 +502,6 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
discard_qp: discard_qp:
inet_frag_kill(&qp->q); inet_frag_kill(&qp->q);
err = -EINVAL;
__IP_INC_STATS(net, IPSTATS_MIB_REASM_OVERLAPS); __IP_INC_STATS(net, IPSTATS_MIB_REASM_OVERLAPS);
err: err:
kfree_skb(skb); kfree_skb(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment