Skip to content

Commit 04bef83

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
net: bridge: multicast: fix PIM hello router port marking race
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: [email protected] Fixes: 91b02d3 ("bridge: mcast: add router port on PIM hello message") Signed-off-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a5de4be commit 04bef83

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/bridge/br_multicast.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3264,7 +3264,9 @@ static void br_multicast_pim(struct net_bridge *br,
32643264
pim_hdr_type(pimhdr) != PIM_TYPE_HELLO)
32653265
return;
32663266

3267+
spin_lock(&br->multicast_lock);
32673268
br_ip4_multicast_mark_router(br, port);
3269+
spin_unlock(&br->multicast_lock);
32683270
}
32693271

32703272
static int br_ip4_multicast_mrd_rcv(struct net_bridge *br,

0 commit comments

Comments
 (0)