From: Herbert Xu Subject: Re: [2/3] gso: Handle new frag_list of frags GRO packets Date: Tue, 12 Nov 2013 02:54:37 +0800 Message-ID: <20131111185437.GA12462@gondor.apana.org.au> References: <20131106013038.GA14894@gondor.apana.org.au> <20131106123900.GA20259@gondor.apana.org.au> <20131106133045.GA20931@gondor.apana.org.au> <20131106143927.GA21604@gondor.apana.org.au> <1383767241.21999.9.camel@edumazet-glaptop2.roam.corp.google.com> <20131107004339.GA28156@gondor.apana.org.au> <20131107062234.GA31156@gondor.apana.org.au> <20131107070335.GA31638@gondor.apana.org.au> <20131107070647.GB31638@gondor.apana.org.au> <1383848204.3802.6.camel@bwh-desktop.uk.level5networks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eric Dumazet , David Miller , christoph.paasch@uclouvain.be, netdev@vger.kernel.org, hkchu@google.com, mwdalton@google.com To: Ben Hutchings Return-path: Received: from ringil.hengli.com.au ([178.18.16.133]:35947 "EHLO fornost.hengli.com.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754132Ab3KKSym (ORCPT ); Mon, 11 Nov 2013 13:54:42 -0500 Content-Disposition: inline In-Reply-To: <1383848204.3802.6.camel@bwh-desktop.uk.level5networks.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Nov 07, 2013 at 06:16:44PM +0000, Ben Hutchings wrote: > On Thu, 2013-11-07 at 15:06 +0800, Herbert Xu wrote: > > Recently GRO started generating packets with frag_lists of frags. > > This was not handled by GSO, thus leading to a crash. > > > > Thankfully these packets are of a regular form and are easy to > > handle. This patch handles them by calling skb_segment for each > > frag_list entry. The depth of recursion is limited to just one. > > > > Signed-off-by: Herbert Xu > > > > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > > index 88b7dc6..bcc3f1c 100644 > > --- a/net/core/skbuff.c > > +++ b/net/core/skbuff.c > [...] > > @@ -2855,8 +2853,40 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features) > > nskb->data - tnl_hlen, > > doffset + tnl_hlen); > > > > - if (fskb != skb_shinfo(skb)->frag_list) > > - goto perform_csum_check; > > + if (fskb != skb_shinfo(skb)->frag_list) { > > + struct sk_buff *nsegs; > > + > > + if (nskb->len == len + doffset) > > + goto perform_csum_check; > > + > > + SKB_FRAG_ASSERT(nskb); > > + > > + __skb_pull(nskb, doffset); > > + skb_shinfo(nskb)->gso_size = mss; > > + nsegs = skb_segment(nskb, features); > > + > > + err = PTR_ERR(nsegs); > > + if (IS_ERR(nsegs)) { > > + kfree(nskb); > > Should be kfree_skb(). Thanks for catching this and I have incorporated this into the newer (albeit completely different) version of the patch. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt