From: Artem Savkov <asavkov@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, jstancek@redhat.com,
steffen.klassert@secunet.com, alexander.h.duyck@intel.com
Subject: Re: [PATCH] ip6_offload: check segs for NULL in ipv6_gso_segment.
Date: Thu, 1 Dec 2016 16:07:03 +0100 [thread overview]
Message-ID: <20161201150703.dv463hxgqajqo6pm@shodan.usersys.redhat.com> (raw)
In-Reply-To: <1480602847.18162.288.camel@edumazet-glaptop3.roam.corp.google.com>
On Thu, Dec 01, 2016 at 06:34:07AM -0800, Eric Dumazet wrote:
> On Thu, 2016-12-01 at 14:06 +0100, Artem Savkov wrote:
> > segs needs to be checked for being NULL in ipv6_gso_segment() before calling
> > skb_shinfo(segs), otherwise kernel can run into a NULL-pointer dereference:
>
>
> > Signed-off-by: Artem Savkov <asavkov@redhat.com>
> > ---
> >
>
> > diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
> > index 1fcf61f..89c59e6 100644
> > --- a/net/ipv6/ip6_offload.c
> > +++ b/net/ipv6/ip6_offload.c
> > @@ -99,7 +99,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb,
> > segs = ops->callbacks.gso_segment(skb, features);
> > }
> >
> > - if (IS_ERR(segs))
> > + if (IS_ERR_OR_NULL(segs))
> > goto out;
> >
> > gso_partial = !!(skb_shinfo(segs)->gso_type & SKB_GSO_PARTIAL);
>
> Do you know when was this bug added ?
It started to show up with 4.9-rc4, from what I see the culprit is
07b26c9 gso: Support partial splitting at the frag_list pointer
> Are you sure this is the right fix ?
I am not, but this would have the same behavior as pre-07b26c9 code and
IS_ERR_OR_NULL is used in ipv4's inet_gso_segment().
> Which gso_segment() is returning NULL exactly ?
Unfortunatelly I don't know that and I don't have a good reproducer, the
only way to reproduce this that I currently have is calling
virt-install.
--
Regards,
Artem
next prev parent reply other threads:[~2016-12-01 15:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 13:06 Artem Savkov
2016-12-01 14:34 ` Eric Dumazet
2016-12-01 15:07 ` Artem Savkov [this message]
2016-12-01 15:27 ` Eric Dumazet
2016-12-01 15:19 ` Eric Dumazet
2016-12-02 18:36 ` David Miller
2016-12-02 2:47 Don Bowman
2016-12-02 11:57 ` Artem Savkov
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=20161201150703.dv463hxgqajqo6pm@shodan.usersys.redhat.com \
--to=asavkov@redhat.com \
--cc=alexander.h.duyck@intel.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jstancek@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.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
all inboxes | Powered by JetHome®