From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753029AbcAGMDv (ORCPT ); Thu, 7 Jan 2016 07:03:51 -0500 Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:44863 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752969AbcAGMDq (ORCPT ); Thu, 7 Jan 2016 07:03:46 -0500 Date: Thu, 7 Jan 2016 13:03:39 +0100 From: Florian Westphal To: Konstantin Khlebnikov Cc: Florian Westphal , Thadeu Lima de Souza Cascardo , Cong Wang , Linux Kernel Network Developers , David Miller , Eric Dumazet , Linux Kernel Mailing List Subject: Re: [BUG] skb corruption and kernel panic at forwarding with fragmentation Message-ID: <20160107120339.GC23789@breakpoint.cc> References: <20160106210532.GE27290@indiana.gru.redhat.com> <20160106220334.GA23789@breakpoint.cc> <20160106234943.GB23789@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Konstantin Khlebnikov wrote: > On Thu, Jan 7, 2016 at 2:49 AM, Florian Westphal wrote: > > ... but it seems that those three are the only affected callers > > of skb_gso_segment (tbf is ok since skb isn't owned by anyone, > > ovs does save/restore already). > > > > I think this patch is the right way, we just need similar > > save/restore in nfqnl_enqueue_packet and xfrm_output_gso(). > > Which CB could be here? at this point skb isn't owned by netlink yet. inet(6)_skb_parm, nfqnl_enqueue_packet is called via netfilter hooks, skb is owned by ipv4 or ipv6 stack. > > The latter two can be used by either ipv4 or ipv6 so it might > > be preferable to just save/restore sizeof(struct skb_gso_cb); > > or a union of inet_skb_parm+inet6_skb_parm. > > Or just shift GSO CB and add couple checks like > BUILD_BUG_ON(sizeof(SKB_GSO_CB(skb)->room) < sizeof(*IPCB(skb))); Right, that works too.