From: Greg Kroah-Hartman Date: Thu, 31 Jan 2019 14:59:51 +0000 (+0100) Subject: Fix "net: ipv4: do not handle duplicate fragments as overlapping" X-Git-Tag: rel_imx_4.19.35_1.1.0~6947 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=8c763a3cf5027f1314d27852dd42656e0491e550;p=linux.git Fix "net: ipv4: do not handle duplicate fragments as overlapping" ade446403bfb ("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 0ff89efb5246 ("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: ade446403bfb ("net: ipv4: do not handle duplicate fragments as overlapping") Reported-by: Ivan Babrou Reported-by: Eric Dumazet Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index f8bbd693c19c..d95b32af4a0e 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -425,6 +425,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) * fragment. */ + err = -EINVAL; /* Find out where to put this fragment. */ prev_tail = qp->q.fragments_tail; if (!prev_tail) @@ -501,7 +502,6 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) discard_qp: inet_frag_kill(&qp->q); - err = -EINVAL; __IP_INC_STATS(net, IPSTATS_MIB_REASM_OVERLAPS); err: kfree_skb(skb);