From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Westphal Subject: Re: ip_rcv_finish() NULL pointer kernel panic Date: Thu, 26 Jan 2017 17:24:33 +0100 Message-ID: <20170126162433.GB1778@breakpoint.cc> References: <1485446279.5145.141.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: Roy Keene , netdev@vger.kernel.org, netfilter-devel@vger.kernel.org To: Eric Dumazet Return-path: Content-Disposition: inline In-Reply-To: <1485446279.5145.141.camel@edumazet-glaptop3.roam.corp.google.com> Sender: netfilter-devel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Eric Dumazet wrote: > > Though possibly with different things not setting the "input" function > > pointer in the "struct dst_entry". > > > > include/net/dst.h: > > 496 static inline int dst_input(struct sk_buff *skb) { > > 498 return skb_dst(skb)->input(skb); > > 499 } > > > > Is there any reason not to check to see if this pointer is NULL before > > blindly calling it ? > > Sure. It can not be NULL at this point. > > Just look at the code in ip_rcv_finish() : > > It first make sure to get a valid dst. > > Something is broken, probably in bridge netfilter code. > > I suspect the dst here points to &br->fake_rtable, and this is not > expected. > > br_drop_fake_rtable() should have been called somewhere ... I think it makes sense to set dst->incoming to a stub in br_netfilter_rtable_init() to just kfree_skb()+ WARN_ON_ONCE(), no need to add code to ip stack or crash kernel due to brnf bug.