Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp705244pxu; Thu, 3 Dec 2020 10:30:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxF60hIG3VcJ+mQ7iOoUYfKntkj4vxbeVdDs6J7jg5rJRw69J6fwe8dvNBE0O0YFTVnXX9z X-Received: by 2002:aa7:c892:: with SMTP id p18mr4143745eds.64.1607020233446; Thu, 03 Dec 2020 10:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607020233; cv=none; d=google.com; s=arc-20160816; b=uhZwArd58dZNhRYZ97/z9EkoLIQR/9ZDjTCObYseQmboYp2y98yuZ6woQVLUfhfBG1 IFxUcBmIpsMQWzzDFiO20/VofGJGIXEt6GVtzxDAKXbWNSZB0gceAnZt7+FoZP344alb uWgyyLXCEz03WQF8a+qwcckqQbeeHLXRnhD5d9Je5PY+KX5fPshqHXzRabCMBmbIDahC rVjGIwg0qW1g5hL8/CBEytLdCoFpNGOldgEujIBN29gVZWn6XIxmWGyLaUisnYLMYSuA GLkETdKfQmAo3RE3uCUQR+40S9BSdPEFquBt++JCbrI+UhQS4o6QfXH0wXYtLZaY01W3 bVWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:dkim-signature :date; bh=ImcVTNZhEra0tHPCiLkqGZGiPBS/dizRysmwrbSqEaQ=; b=c9nSzd13HLV+Jhc7WDkXBsYNG/hHu+1jlp+21fhbNfkQfvzv27e0cUR1+xzc5laR3B 0QmvRyrS4TAH+DQ2r3SkGoGvcD03hZTcgRokPSxYMdo4jZUXq7r0rr75/PEA8zuE4HBq 9jlu5bkMPAN1fgCdjsIKXxqaHo7PuS7rgE3dR3rS0cZDyM+d8rRrdnFnKbDNYmOUQiwS QenBcTmLfGf9Lfx9M6/RhkEbZrYPRoOvWNp6+uZ+G82VM+Pr5C/BVW5ZXnLR8XG00rHI zFwnNzMR4IoKAf2h3M2UIRiDSaYLPUcAFa6bE2t4cab1J5jgqWW28o1nA8jA7f68kmXZ th5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A06Bm35m; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si1441217edx.275.2020.12.03.10.30.08; Thu, 03 Dec 2020 10:30:33 -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=@kernel.org header.s=k20201202 header.b=A06Bm35m; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729822AbgLCS2p (ORCPT + 99 others); Thu, 3 Dec 2020 13:28:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:55734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728893AbgLCS2o (ORCPT ); Thu, 3 Dec 2020 13:28:44 -0500 Date: Thu, 3 Dec 2020 10:28:02 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607020083; bh=79pVmEiGY09uStaLdHgvpv8VoidOztdyQWlxY1kgCwA=; h=From:To:Cc:Subject:In-Reply-To:References:From; b=A06Bm35mVRT0NBoRGsjIZQoIWX4hX325fHqCGBaEwR25QoJ9Q2UtEamABN2nliHl4 ump2zDNxgagmbC3XrzMg2+xW3zNMSX75zQKoh0Fv4bOKLa01gNNCKuhjzO2kBelZfa uTxqeLVYTmaLL2IVLjL0frhVg/q0RKSzC6V7yKcdLwf8eqTfrPDPEn2Xg1V6DHQdat lez353KoHeaKE4+6Kud9rQ4ugNwA7KGd8gQSHO0Rd+FKHCuByIeR3aUgxvyX05E3ep tnxZNBsK8ogPXwRGPIFDWL074hiivScxOP5RsJ7xx0R8SjCTXr4c7ioF6ra9t9Kgqu UxeWEJoOC4amQ== From: Jakub Kicinski To: Joseph Huang Cc: Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , , , , Linus =?UTF-8?B?TMO8c3Npbmc=?= Subject: Re: [PATCH] bridge: Fix a deadlock when enabling multicast snooping Message-ID: <20201203102802.62bc86ba@kicinski-fedora-pc1c0hjn.DHCP.thefacebook.com> In-Reply-To: <20201201214047.128948-1-Joseph.Huang@garmin.com> References: <20201201214047.128948-1-Joseph.Huang@garmin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 Dec 2020 16:40:47 -0500 Joseph Huang wrote: > When enabling multicast snooping, bridge module deadlocks on multicast_lock > if 1) IPv6 is enabled, and 2) there is an existing querier on the same L2 > network. > > The deadlock was caused by the following sequence: While holding the lock, > br_multicast_open calls br_multicast_join_snoopers, which eventually causes > IP stack to (attempt to) send out a Listener Report (in igmp6_join_group). > Since the destination Ethernet address is a multicast address, br_dev_xmit > feeds the packet back to the bridge via br_multicast_rcv, which in turn > calls br_multicast_add_group, which then deadlocks on multicast_lock. > > The fix is to move the call br_multicast_join_snoopers outside of the > critical section. This works since br_multicast_join_snoopers only deals > with IP and does not modify any multicast data structures of the bridge, > so there's no need to hold the lock. > > Fixes: 4effd28c1245 ("bridge: join all-snoopers multicast address") > > Signed-off-by: Joseph Huang Nik, Linus - how does this one look?