netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Eric Dumazet <edumazet@google.com>
Cc: Ivan Babrou <ivan@cloudflare.com>,
	Michal Kubecek <mkubecek@suse.cz>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Ignat Korchagin <ignat@cloudflare.com>,
	Shawn Bohrer <sbohrer@cloudflare.com>,
	Jakub Sitnicki <jakub@cloudflare.com>
Subject: Re: BUG: KASAN: double-free or invalid-free in ip_defrag after upgrade from 4.19.13
Date: Thu, 31 Jan 2019 13:48:16 +0100	[thread overview]
Message-ID: <20190131124816.GA8031@kroah.com> (raw)
In-Reply-To: <CANn89iJaTAHvKesjibA91hP-1cqHUzBRVmxBHrw0G=9K0twsfw@mail.gmail.com>

On Wed, Jan 30, 2019 at 03:16:56PM -0800, Eric Dumazet wrote:
> On Wed, Jan 30, 2019 at 3:13 PM Eric Dumazet <edumazet@google.com> wrote:
> >
> > On Wed, Jan 30, 2019 at 3:09 PM Ivan Babrou <ivan@cloudflare.com> wrote:
> > >
> > > Eric,
> > >
> > > Are you going to propose the change then?
> > >
> > > I'm happy to test it out.
> > >
> >
> > This is indeed a bug in linux stable tree only.
> >
> > The err=-EINVAL move was part of a patch that was not backported
> > (since it was not a bug fix)
> >
> > commit 0ff89efb524631ac9901b81446b453c29711c376
> > Author: Peter Oskolkov <posk@google.com>
> > Date:   Tue Aug 28 11:36:19 2018 -0700
> >
> >     ip: fail fast on IP defrag errors
> >
> >
> 
> Greg, the fix for 4.19 (and maybe other stable trees ?) would be :
> 
> diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
> index f8bbd693c19c247e41839c2d0b5318ca51b23ee8..d95b32af4a0e3f552405c9e61cc372729834160c
> 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);
> 

Thanks for this, I'll turn this into a real patch and backport it to
where it is needed.

greg k-h

  reply	other threads:[~2019-01-31 12:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 22:26 BUG: KASAN: double-free or invalid-free in ip_defrag after upgrade from 4.19.13 Ivan Babrou
2019-01-30 22:50 ` Eric Dumazet
2019-01-30 22:57   ` Eric Dumazet
2019-01-30 23:00 ` Michal Kubecek
2019-01-30 23:09   ` Ivan Babrou
2019-01-30 23:13     ` Eric Dumazet
2019-01-30 23:16       ` Eric Dumazet
2019-01-31 12:48         ` Greg Kroah-Hartman [this message]
2019-01-31 15:05           ` Eric Dumazet
2019-01-31 17:38           ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190131124816.GA8031@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ignat@cloudflare.com \
    --cc=ivan@cloudflare.com \
    --cc=jakub@cloudflare.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=sbohrer@cloudflare.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).