Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1330586pxb; Wed, 4 Nov 2020 06:16:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy26pxPOQryGs3xm57+20QfrZV16YenldxZJQM9/I2EZDcs1yevBhI63H5fZEB9KK4NLIHq X-Received: by 2002:a17:906:2548:: with SMTP id j8mr24677512ejb.140.1604499391268; Wed, 04 Nov 2020 06:16:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604499391; cv=none; d=google.com; s=arc-20160816; b=enHLBFw+l819RME3VVMBklABqfodfdK4n1qTPC7AZV7wmHqCYJAUGW8NsBo3U+jJS5 q6fEjBDJeNZECRaCuSAJNofEzMJ+faV2ytj/vB6mIsjXcA//t14j96xISTzEnQgy3TgI MCMoIXN7kdlEM2w2M+DlZWN0TjdLFbwj85WxUbAPEeOQ6McbYtHicQTEMFdnZQpYD1ZQ SF/8gwFVW6+aJDbZQPyD/ff9VZzjo0SkUvhTgtrtOV4s7dRBuHW0cp/DqecpA1+h69mM vzjIan8m4lOZ8K2i4yP3obuZDayxiwvm6O6OxzBNRRSLAqr6o4e+YbDVOKkoKjbHhWw4 CZEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=S4tBycIgGpMbcu0VMkG4KdXUec3BMb9c9CGZHnWqcbY=; b=Vy3lXWBqXom1e2qVi1mgn2SWscHqQaTmdJCaTieNWB0Nu6GwJ4XRJt0g3HPC+DN6Gk VGKjMwle/RNptioS1Hb6+MgGOCeI0GzNySL4Qtb5V3s5sLdg20vlPbsGQd9K2Plw6ae8 WhvUWuv2x3eQYVxI8KySGsBqiyINuuk55JmkxzUB6VMFTMinDHph2myp6rC2ZTv8dzkA jy8DDqJo++qzrG/JjwG+Jr3BLZZVhpnIF/7+aT0EqRExMXIoeDXYvyf+VRkwMWNzzdC3 gmyCmMvkh5Pd5smtpnotpuW+Q8IIcmH5kwow9LoYVtpaRuIkpTrYNhKvQHGnSoz2o0Za MSyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Uby3FcRK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qu17si1432023ejb.266.2020.11.04.06.16.07; Wed, 04 Nov 2020 06:16:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Uby3FcRK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729851AbgKDOOt (ORCPT + 99 others); Wed, 4 Nov 2020 09:14:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbgKDOOt (ORCPT ); Wed, 4 Nov 2020 09:14:49 -0500 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB70FC0613D3; Wed, 4 Nov 2020 06:14:48 -0800 (PST) Received: by mail-lf1-x144.google.com with SMTP id 141so27329673lfn.5; Wed, 04 Nov 2020 06:14:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S4tBycIgGpMbcu0VMkG4KdXUec3BMb9c9CGZHnWqcbY=; b=Uby3FcRKI9yEd+t292wdoGg6qfKgNlGfPsu1x0mVGxqu4Y47S9/9jU5Vxln+Ev3Qhx QbyLO4xbXEt4pFY2a6mKUgkwVQd8WgbDmCqx2kIdEjJ02R7HeuRwxSJPlT7xxEDIDXuB BWexSWV6ahCPrWKjTIXgATLahYkMiPwplw5+TyHp2UIwyIXwY1U2G6kx/jypkG/dWjJI 3rXYCOA7tQeqDXObwuVj2T52B7EBFN44hOsCOKfkH06qOtYgOvqf/oqzYihC2vhVVubS DDE+VGcMLLIizqcQ+bRTmv8Bc3vRrrV/Ij/sPzOUEo6F3pc2QmtXHDqPP9GtETPHGBy5 Bodg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S4tBycIgGpMbcu0VMkG4KdXUec3BMb9c9CGZHnWqcbY=; b=tPTectZPSSOQxtLRMrS60dR1ysdU2KwEvmW5PmlUtOcNQzSIcrzpZHSUa9JkR4ay7Y PAQju79J18kBVE0DPQAuT9lidAut9yDVarAS6iqUmhrRapq78xuxmzKQkjUYfiWuT2iB LrXbmK8nCnvMFV0K561fkI/VOBsie88Og4NxGzYMEaIMIeh/eH5FBf8geFOA5D3ln5h8 9L3WzQZyMjtdg8BcUYhgXZOxOq4Tl9asy64AEhNUrJTNRLU3oinMr81MUMUpvhxJqPud L43vVIYYwUXJP0Ort9r3Yhbcqg/fXPwnSlSK3e3a9B5fsfMWd0ppmiGklHVwnrm4ClR/ pa8Q== X-Gm-Message-State: AOAM531rmbd5rQtqv5lZ0cUCrWmw+PfXDXLEfKSNn0KlhJvReyQTZVZb ujwoV4ev4oN/gL6DGcGFAIlBPrl5wjlW0oqOLaM= X-Received: by 2002:a19:220d:: with SMTP id i13mr9204844lfi.37.1604499287209; Wed, 04 Nov 2020 06:14:47 -0800 (PST) MIME-Version: 1.0 References: <20201102143828.5286-1-menglong8.dong@gmail.com> <067c94269abed15f777ac078a216be314c935fd5.camel@nvidia.com> In-Reply-To: <067c94269abed15f777ac078a216be314c935fd5.camel@nvidia.com> From: Menglong Dong Date: Wed, 4 Nov 2020 22:14:35 +0800 Message-ID: Subject: Re: [PATCH] net: bridge: disable multicast while delete bridge To: Nikolay Aleksandrov Cc: Roopa Prabhu , "bridge@lists.linux-foundation.org" , "dong.menglong@zte.com.cn" , "davem@davemloft.net" , "kuba@kernel.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Nik, On Wed, Nov 4, 2020 at 12:26 AM Nikolay Aleksandrov wrote: > > On Mon, 2020-11-02 at 22:38 +0800, Menglong Dong wrote: > > From: Menglong Dong > > > > This commit seems make no sense, as bridge is destroyed when > > br_multicast_dev_del is called. > > > > In commit b1b9d366028f > > ("bridge: move bridge multicast cleanup to ndo_uninit"), Xin Long > > fixed the use-after-free panic in br_multicast_group_expired by > > moving br_multicast_dev_del to ndo_uninit. However, that patch is > > not applied to 4.4.X, and the bug exists. > > > > Fix that bug by disabling multicast in br_multicast_dev_del for > > 4.4.X, and there is no harm for other branches. > > > > Signed-off-by: Menglong Dong > > --- > > net/bridge/br_multicast.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c > > index eae898c3cff7..9992fdff2951 100644 > > --- a/net/bridge/br_multicast.c > > +++ b/net/bridge/br_multicast.c > > @@ -3369,6 +3369,7 @@ void br_multicast_dev_del(struct net_bridge *br) > > hlist_for_each_entry_safe(mp, tmp, &br->mdb_list, mdb_node) > > br_multicast_del_mdb_entry(mp); > > hlist_move_list(&br->mcast_gc_list, &deleted_head); > > + br_opt_toggle(br, BROPT_MULTICAST_ENABLED, false); > > spin_unlock_bh(&br->multicast_lock); > > > > br_multicast_gc(&deleted_head); > > This doesn't make any sense. It doesn't fix anything. > If 4.4 has a problem then the relevant patches should get backported to it. > We don't add random changes to fix older releases. > > Cheers, > Nik > > Nacked-by: Nikolay Aleksandrov Thanks for your patient explanation, and I see it now~ Cheers, Menglong Dong