From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: pablo@netfilter.org Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 14152ef5 for ; Wed, 30 May 2018 18:03:45 +0000 (UTC) Received: from mail.us.es (mail.us.es [193.147.175.20]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 0bbe799c for ; Wed, 30 May 2018 18:03:45 +0000 (UTC) Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id E15EF172C6D for ; Wed, 30 May 2018 20:05:18 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 38231DA81B for ; Wed, 30 May 2018 20:04:41 +0200 (CEST) Date: Wed, 30 May 2018 20:05:47 +0200 From: Pablo Neira Ayuso To: "Jason A. Donenfeld" Subject: Re: Missing skb->dst with flow offloading Message-ID: <20180530180547.kn4cikprj7drhlc3@salvia> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Cc: Netdev , netfilter-devel@vger.kernel.org, Jaap Buurman , openwrt-devel@lists.openwrt.org, WireGuard mailing list , Felix Fietkau List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Jason, On Wed, May 30, 2018 at 02:01:05AM +0200, Jason A. Donenfeld wrote: > Hey Pablo, > > Some OpenWRT people have reported to me that there's a crash when > enabling flow offloading, because I rely on skb_dst(skb) being > non-null in ndo_start_xmit. The fix in my code for this is very > simple: > > - mtu = dst_mtu(skb_dst(skb)); > + dst = skb_dst(skb); > + mtu = dst ? dst_mtu(dst) : dev->mtu; > > I can make this change, but I wanted to be certain first that omitting > the dst in the skb is intentional on your part. (If so, there might be > other drivers to fix as well.) In tracing this, it looks like a packet > that's forwarded from a flow offloaded interface to a virtual > interface gets diverted immediately via neigh_xmit, where it is then > passed to a virtual interface via dev_queue_xmit. I can't see anywhere > along this path a call to skb_dst_set. Perhaps this is intended, as > flow offloading is supposed to skip the routing table? Or is there an > oversight in the new flow offloading code? > > I'd appreciate your input, so that I can make the appropriate change > -- or not -- to my code. If there a more drivers in-tree that need this, we may add skb_dst_set_noref() calls to _hook function in the flowtable codebase.