From patchwork Tue Jan 27 11:58:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steffen Klassert X-Patchwork-Id: 433328 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5C4301401AC for ; Tue, 27 Jan 2015 22:58:30 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756055AbbA0L61 (ORCPT ); Tue, 27 Jan 2015 06:58:27 -0500 Received: from a.mx.secunet.com ([195.81.216.161]:58336 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752317AbbA0L6Z (ORCPT ); Tue, 27 Jan 2015 06:58:25 -0500 Received: from localhost (alg1 [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 19B9C1A009F; Tue, 27 Jan 2015 12:58:14 +0100 (CET) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id F6Yi1lso45_q; Tue, 27 Jan 2015 12:58:09 +0100 (CET) Received: from mail-essen-01.secunet.de (unknown [10.53.40.204]) by a.mx.secunet.com (Postfix) with ESMTP id 391461A009D; Tue, 27 Jan 2015 12:58:09 +0100 (CET) Received: from gauss.dd.secunet.de (10.182.7.102) by mail-essen-01.secunet.de (10.53.40.204) with Microsoft SMTP Server id 14.3.224.2; Tue, 27 Jan 2015 12:58:19 +0100 Received: by gauss.dd.secunet.de (Postfix, from userid 1000) id AF9895C027F; Tue, 27 Jan 2015 12:58:15 +0100 (CET) Date: Tue, 27 Jan 2015 12:58:15 +0100 From: Steffen Klassert To: Chris Ruehl CC: Hannes Frederic Sowa , , Subject: Re: ipv6: oops in datagram.c line 260 Message-ID: <20150127115814.GL13046@secunet.com> References: <5487DD65.60800@gtsys.com.hk> <549AC2B4.8070203@gtsys.com.hk> <1420560073.32369.60.camel@redhat.com> <20150126083512.GI13046@secunet.com> <54C71AFB.40300@gtsys.com.hk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <54C71AFB.40300@gtsys.com.hk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [10.182.7.102] X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Jan 27, 2015 at 12:58:35PM +0800, Chris Ruehl wrote: > > Steffen, > > your patch can't apply to the vanilla v3.14.29 can you cross check please. Sorry, this patch was based on the net tree. > I'm sorry but we running a productive system and I can't make to much > noise here! > Your patch is partly in the 3.14.29 and > skb->protocol = htons(ETH_P_IP) > from the xfrm4/6_output_finish() no removed. I do then > > --- linux-3.14.x/net/ipv4/xfrm4_output.c.orig    2015-01-27 > 12:50:01.830651344 +0800 > +++ linux-3.14.x/net/ipv4/xfrm4_output.c    2015-01-27 12:51:13.280386355 > +0800 > @@ -82,7 +82,6 @@ >      IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED; >  #endif >   > -    skb->protocol = htons(ETH_P_IP); >      return xfrm_output(skb); >  } >   > --- linux-3.14.x/net/ipv6/xfrm6_output.c.orig    2015-01-27 > 12:49:39.260735321 +0800 > +++ linux-3.14.x/net/ipv6/xfrm6_output.c    2015-01-27 12:50:47.280482636 > +0800 > @@ -132,7 +132,6 @@ >      IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED; >  #endif >   > -    skb->protocol = htons(ETH_P_IPV6); >      return xfrm_output(skb); >  } Yes, that should be ok. Here is the complete patch for v3.14.29: Subject: [PATCH RFC v3.14.29] xfrm: Fix local error reporting crash with interfamily tunnels We set the outer mode protocol too early. As a result, the local error handler might dispatch to the wrong address family and report the error to a wrong socket type. We fix this by seting the outer protocol to the skb only after we accessed the inner mode for the last time, right before we do the atcual encapsulation where we switch finally to the outer mode. The settings in xfrm{4,6}_output_finish() are removed. Reported-by: Chris Ruehl Signed-off-by: Steffen Klassert Tested-by: Chris Ruehl --- net/ipv4/xfrm4_output.c | 1 - net/ipv6/xfrm6_output.c | 1 - 2 files changed, 0 insertions(+), 2 deletions(-) diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c index baa0f63..0cb9606 100644 --- a/net/ipv4/xfrm4_output.c +++ b/net/ipv4/xfrm4_output.c @@ -82,7 +82,6 @@ int xfrm4_output_finish(struct sk_buff *skb) IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED; #endif - skb->protocol = htons(ETH_P_IP); return xfrm_output(skb); } diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index 6cd625e..98396cf 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c @@ -132,7 +132,6 @@ int xfrm6_output_finish(struct sk_buff *skb) IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED; #endif - skb->protocol = htons(ETH_P_IPV6); return xfrm_output(skb); }