netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: kraigatgoog@gmail.com
Cc: andreyknvl@google.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ipv6: Prevent overrun when parsing v6 header options
Date: Wed, 17 May 2017 14:57:30 -0400 (EDT)	[thread overview]
Message-ID: <20170517.145730.76726417606716563.davem@davemloft.net> (raw)
In-Reply-To: <20170516183623.84966-1-kraigatgoog@gmail.com>

From: Craig Gallek <kraigatgoog@gmail.com>
Date: Tue, 16 May 2017 14:36:23 -0400

> From: Craig Gallek <kraig@google.com>
> 
> The KASAN warning repoted below was discovered with a syzkaller
> program.  The reproducer is basically:
>   int s = socket(AF_INET6, SOCK_RAW, NEXTHDR_HOP);
>   send(s, &one_byte_of_data, 1, MSG_MORE);
>   send(s, &more_than_mtu_bytes_data, 2000, 0);
> 
> The socket() call sets the nexthdr field of the v6 header to
> NEXTHDR_HOP, the first send call primes the payload with a non zero
> byte of data, and the second send call triggers the fragmentation path.
> 
> The fragmentation code tries to parse the header options in order
> to figure out where to insert the fragment option.  Since nexthdr points
> to an invalid option, the calculation of the size of the network header
> can made to be much larger than the linear section of the skb and data
> is read outside of it.
> 
> This fix makes ip6_find_1stfrag return an error if it detects
> running out-of-bounds.
 ...
> Reported-by: Andrey Konovalov <andreyknvl@google.com>
> Signed-off-by: Craig Gallek <kraig@google.com>

Since this is a reasonably serious bug I'm going to apply this
to 'net' and queue it up for -stable.

Thanks.

      reply	other threads:[~2017-05-17 18:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 18:36 [PATCH net-next] ipv6: Prevent overrun when parsing v6 header options Craig Gallek
2017-05-17 18:57 ` David Miller [this message]

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=20170517.145730.76726417606716563.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andreyknvl@google.com \
    --cc=kraigatgoog@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).