From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: Re: [PATCH net] net: sched: fix NULL pointer dereference when action calls some targets Date: Thu, 17 Aug 2017 14:44:54 +0200 Message-ID: <20170817124454.GA29209@salvia> References: <0fa9a53725dd661571461cf283ec88cf15f4b139.1501932907.git.lucien.xin@gmail.com> <20170817100220.GC6928@salvia> <20170817103344.GA7568@salvia> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Cong Wang , network dev , David Miller , netfilter-devel@vger.kernel.org, Jamal Hadi Salim To: Xin Long Return-path: Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-Id: netfilter-devel.vger.kernel.org On Thu, Aug 17, 2017 at 11:24:00PM +1200, Xin Long wrote: > On Thu, Aug 17, 2017 at 10:33 PM, Pablo Neira Ayuso wrote: > > On Thu, Aug 17, 2017 at 12:02:20PM +0200, Pablo Neira Ayuso wrote: > >> On Wed, Aug 16, 2017 at 08:39:44PM +1200, Xin Long wrote: > >> > On Wed, Aug 9, 2017 at 7:33 AM, Cong Wang wrote: > >> > > On Mon, Aug 7, 2017 at 7:33 PM, Xin Long wrote: > >> > >> On Tue, Aug 8, 2017 at 9:15 AM, Cong Wang wrote: > >> > >>> This looks like a completely API burden? > >> > >> netfilter xt targets are not really compatible with netsched action. > >> > >> I've got to say, the patch is just a way to make checkentry return > >> > >> false and avoid panic. like [1] said > >> > > > >> > > I don't doubt you fix a crash, I am thinking if we can > >> > > "fix" the API instead of fixing the caller. > >> > Hi, Cong, > >> > > >> > For now, I don't think it's possible to change APIs or some of their targets > >> > for the panic caused by action xt calling. > >> > > >> > The common way should be fixed in net_sched side. > >> > > >> > Given that the issue is very easy to triggered, > >> > let's wait for netfilter's replies for another few days, > >> > otherwise I will repost the fix, agree ? > >> > >> Please, post the workaround so the kernel doesn't crash anymore. > >> > >> This is going to be very hard to fix, it's broken since the very > >> beginning... > > > > Wait a second, you could rename par->nft_compat to par->no_entry. From > > net/sched/ you can set this to 1, so the entry checks are ignored. > > > > I'm refering to patch 55917a21d0cc0 > > par->nft_compat wasn't used to ignore the entry checks, if we rename it > as no_entry, some other targets still needs to update. like the ones in > this patch's changelog: > ECN: ecn_tg_check() > TPROXY: tproxy_tg4_check() > > which means these two checks will be ignored for nft as well, that is > not what we want. > As nft has e4.ip.proto and e4.ip.invflags being set which net/sched > gets nothing. they are still different. I see, then just fix this crash. It's been known among people that the number of extensions that act_ipt supports is limited. Thanks.