Skip to content

Commit f58f45c

Browse files
blocktrrondavem330
authored andcommitted
vxlan: drop packets from invalid src-address
The VXLAN driver currently does not check if the inner layer2 source-address is valid. In case source-address snooping/learning is enabled, a entry in the FDB for the invalid address is created with the layer3 address of the tunnel endpoint. If the frame happens to have a non-unicast address set, all this non-unicast traffic is subsequently not flooded to the tunnel network but sent to the learnt host in the FDB. To make matters worse, this FDB entry does not expire. Apply the same filtering for packets as it is done for bridges. This not only drops these invalid packets but avoids them from being learnt into the FDB. Fixes: d342894 ("vxlan: virtual extensible lan") Suggested-by: Ido Schimmel <[email protected]> Signed-off-by: David Bauer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 69197df commit f58f45c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/vxlan/vxlan_core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,10 @@ static bool vxlan_set_mac(struct vxlan_dev *vxlan,
16151615
if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr))
16161616
return false;
16171617

1618+
/* Ignore packets from invalid src-address */
1619+
if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
1620+
return false;
1621+
16181622
/* Get address from the outer IP header */
16191623
if (vxlan_get_sk_family(vs) == AF_INET) {
16201624
saddr.sin.sin_addr.s_addr = ip_hdr(skb)->saddr;

0 commit comments

Comments
 (0)