Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp395879yba; Wed, 3 Apr 2019 10:47:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMf0VKh34TzAUcYSU2tsoMUxq3fI+YVlSj5z8kqculZCHkWfNXANYTqdSVgoWZdHunIKfq X-Received: by 2002:a17:902:7043:: with SMTP id h3mr1339511plt.228.1554313627932; Wed, 03 Apr 2019 10:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554313627; cv=none; d=google.com; s=arc-20160816; b=n/sE48UDbKPcQHyGjG+tTVCXd8fAoFE+5Lz3O68V21T4ADf170QMywAJ6ThvrqcuRC vD21VvBGe7kvxs0tW9V2kdB0YIMYpW7uNWh/JgngHMovMV5HMOOIgbLL5TNLyHSrS81P NTtg2nnmmfJ5gDGPxPIsugV/bSxYhLMvc2YUikZYyKiA4NnuDFlzvjcVjdpAfXJjSuxx c1s31x9atS25nXlak82EOepVr3qBAyQ4NaD/MIgHA9Kx8gohpT0C5+cSh6INpXpKGXIP EvXck+mWg2LceEBSWi1rsdiiePAtU6DdAqmoPjUXe2gqfjtFn8Ziqf+2MZAmGCFCPvFK AiLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uS2MozYMAHKnQL9AGs711f2xEof7QEn7/2SxUNiyN+E=; b=HargHPK96302ULXyh6X2oZUl4qx3d+AX6OFObskoXSqU6yK2D5BJ9e8gXyx96p1JH/ pLKiyA2SkkD2u7Sh6jlEPYxULkmEQP4+bT/QHVQVTuirVcbv2FzZSpAcZPCUNQp/5K+5 B75ujxntShGblQYRM5wQcTShHg29GMjAOuxFU5DE9OOWpQmNuFlSu9I7m+Jw5YXm30DO Xza2WpXB56QEb+rTWG38TSPZRbFiLSRv55WJo6P6rzscJmrID+/X1LCdPmb10SPglmq8 v2ABC7G9QMDBrfmvrEPGs0k7vJSXEGxybIrlEGsau4K0r3Nwaxvb9Myq1gc/T6Suz/cj znXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si14159165pgl.264.2019.04.03.10.46.52; Wed, 03 Apr 2019 10:47:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726468AbfDCRos (ORCPT + 99 others); Wed, 3 Apr 2019 13:44:48 -0400 Received: from ganesha.gnumonks.org ([213.95.27.120]:52530 "EHLO ganesha.gnumonks.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbfDCRos (ORCPT ); Wed, 3 Apr 2019 13:44:48 -0400 Received: from sys.soleta.eu ([212.170.55.40] helo=gnumonks.org) by ganesha.gnumonks.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1hBjwI-0001aj-6v; Wed, 03 Apr 2019 19:44:44 +0200 Date: Wed, 3 Apr 2019 19:44:41 +0200 From: Pablo Neira Ayuso To: Rundong Ge Cc: kadlec@blackhole.kfki.hu, fw@strlen.de, roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com, davem@davemloft.net, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netfilter:bridge: Hold bridge dev for fake_rtable to avoid the dangling pointer Message-ID: <20190403174441.2l7xyk5o2hftrdm3@salvia> References: <20190402125609.30313-1-rdong.ge@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190402125609.30313-1-rdong.ge@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Score: -2.6 (--) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 02, 2019 at 12:56:09PM +0000, Rundong Ge wrote: > Problem: > When bridge-nf-call-iptables is enabled, skb_dst(skb) of packets that > in the nfqueue may be a dangling pointer if user delete the bridge. > Because packets go through the br_nf_pre_routing_finish will set the dst > pointer to the br->fake_rtable. But the br struct will be freed > without the reference check for these skbs. > > User impact: > Kernel panic may happen when user delete the bridge if there are > continuous traffics go through the nfqueue. > Here is a panic in my device which using kernel v3.10. This kernel is _very old_. Could you provide the steps to reproduce this issue? Holding the device doesn't seem the way to go to me, we have a of netdevice_notifier that is dropping packets for an interface that is gone in nfnetlink_queue. We also drop packets whenever a hook in gone. So I wonder if this is still a problem in mainline kernels.