lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250201113412.107832-1-znscnchen@gmail.com>
Date: Sat,  1 Feb 2025 19:34:12 +0800
From: Ted Chen <znscnchen@...il.com>
To: davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com,
	andrew+netdev@...n.ch
Cc: netdev@...r.kernel.org,
	Ted Chen <znscnchen@...il.com>
Subject: [PATCH RFC net-next 2/3] vxlan: Do not treat vxlan dev as used when unicast remote_ip mismatches

Do not treat a vxlan_dev as used if the vxlan to be configured shares the
same vni as an existing vxlan_dev but has a different unicast remote_ip.

This enables multiple vxlan devices with distinct unicast remote_ips to be
bound to a single vni.

Signed-off-by: Ted Chen <znscnchen@...il.com>
---
 drivers/net/vxlan/vxlan_core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index 3ca74a97c44f..5ef40ac816cc 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -3723,6 +3723,10 @@ int vxlan_vni_in_use(struct net *src_net, struct vxlan_dev *vxlan,
 		} else if (tmp->cfg.vni != vni) {
 			continue;
 		}
+		if (!vxlan_addr_any(&conf->remote_ip) &&
+		    !vxlan_addr_multicast(&conf->remote_ip) &&
+		    !vxlan_addr_equal(&tmp->cfg.remote_ip, &conf->remote_ip))
+			continue;
 		if (tmp->cfg.dst_port != conf->dst_port)
 			continue;
 		if ((tmp->cfg.flags & (VXLAN_F_RCV_FLAGS | VXLAN_F_IPV6)) !=
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ