net: bridge: multicast: fix MRD advertisement router port marking race
authorNikolay Aleksandrov <nikolay@nvidia.com>
Sun, 11 Jul 2021 09:56:29 +0000 (12:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:37 +0000 (16:05 +0200)
commit9ebcc60565f2667a72d1f44289c71e097f632d43
tree83b1d84af36bd1ebdf1841c132361e35882f986b
parent664cc645bdd8ce3f000a5bec0eee0c7289395c27
net: bridge: multicast: fix MRD advertisement router port marking race

commit 000b7287b67555fee39d39fff75229dedde0dcbf upstream.

When an MRD advertisement is received on a bridge port with multicast
snooping enabled, we mark it as a router port automatically, that
includes adding that port to the router port list. The multicast lock
protects that list, but it is not acquired in the MRD advertisement case
leading to a race condition, we need to take it to fix the race.

Cc: stable@vger.kernel.org
Cc: linus.luessing@c0d3.blue
Fixes: 4b3087c7e37f ("bridge: Snoop Multicast Router Advertisements")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bridge/br_multicast.c