From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Westphal Subject: Re: crash in xt_policy due to skb_dst_drop() in nf_ct_frag6_gather() Date: Tue, 16 Oct 2018 10:11:20 +0200 Message-ID: <20181016081120.umbe3kz2vi4jfgks@breakpoint.cc> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Lorenzo Colitti , Eric Dumazet , Florian Westphal , Linux NetDev , Maciej Zenczykowski To: Maciej =?utf-8?Q?=C5=BBenczykowski?= Return-path: Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:41766 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbeJPQAf (ORCPT ); Tue, 16 Oct 2018 12:00:35 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Maciej Żenczykowski wrote: I am currently travelling and not able to investigate until next week. > commit ad8b1ffc3efae2f65080bdb11145c87d299b8f9a > Author: Florian Westphal > netfilter: ipv6: nf_defrag: drop skb dst before queueing > > +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c > @@ -618,6 +618,8 @@ int nf_ct_frag6_gather(struct net *net, struct > sk_buff *skb, u32 user) > fq->q.meat == fq->q.len && > nf_ct_frag6_reasm(fq, skb, dev)) > ret = 0; > + else > + skb_dst_drop(skb); This is only supposed to drop dst of skbs that are enqueued, i.e. frag6_gather returns NF_STOLEN. In case skb completes the queue, then that skbs dst_entry is supposed to be kept, so skb_dst() does NOT return NULL. Its not supposed to be any different than ipv4 defrag. > const struct dst_entry *dst = skb_dst(skb); // returns NULL That is not supposed to happen.