From: Nikolay Aleksandrov <razor@blackwall.org> Date: 2021-07-11 09:58:04
From: Nikolay Aleksandrov <redacted>
Hi,
While working on per-vlan multicast snooping I found two race conditions
when multicast snooping is enabled. They're identical and happen when
the router port list is modified without the multicast lock. One requires
a PIM hello message to be received on a port and the other an MRD
advertisement. To fix them we just need to take the multicast_lock when
adding the ports to the router port list (marking them as router ports).
Tested on an affected setup by generating the required packets while
modifying the port list in parallel.
Thanks,
Nik
Nikolay Aleksandrov (2):
net: bridge: multicast: fix PIM hello router port marking race
net: bridge: multicast: fix MRD advertisement router port marking race
net/bridge/br_multicast.c | 6 ++++++
1 file changed, 6 insertions(+)
--
2.31.1
From: Nikolay Aleksandrov <razor@blackwall.org> Date: 2021-07-11 09:58:05
From: Nikolay Aleksandrov <redacted>
When a PIM hello packet is received on a bridge port with multicast
snooping enabled, we mark it as a router port automatically, that
includes adding that port the router port list. The multicast lock
protects that list, but it is not acquired in the PIM message case
leading to a race condition, we need to take it to fix the race.
Cc: stable@vger.kernel.org
Fixes: 91b02d3d133b ("bridge: mcast: add router port on PIM hello message")
Signed-off-by: Nikolay Aleksandrov <redacted>
---
net/bridge/br_multicast.c | 2 ++
1 file changed, 2 insertions(+)
From: Nikolay Aleksandrov <razor@blackwall.org> Date: 2021-07-11 09:58:06
From: Nikolay Aleksandrov <redacted>
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 <redacted>
---
net/bridge/br_multicast.c | 4 ++++
1 file changed, 4 insertions(+)
Hello:
This series was applied to netdev/net.git (refs/heads/master):
On Sun, 11 Jul 2021 12:56:27 +0300 you wrote:
From: Nikolay Aleksandrov <redacted>
Hi,
While working on per-vlan multicast snooping I found two race conditions
when multicast snooping is enabled. They're identical and happen when
the router port list is modified without the multicast lock. One requires
a PIM hello message to be received on a port and the other an MRD
advertisement. To fix them we just need to take the multicast_lock when
adding the ports to the router port list (marking them as router ports).
Tested on an affected setup by generating the required packets while
modifying the port list in parallel.
[...]