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: <174265457014.356712.17642146869021358083.stgit@pro.pro>
Date: Sat, 22 Mar 2025 17:42:50 +0300
From: Kirill Tkhai <tkhai@...ru>
To: netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: tkhai@...ru
Subject: [PATCH NET-PREV 40/51] openvswitch: Make ports share nd_lock of master device

Signed-off-by: Kirill Tkhai <tkhai@...ru>
---
 net/openvswitch/vport-netdev.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c
index 91a11067e458..e629fc3c1442 100644
--- a/net/openvswitch/vport-netdev.c
+++ b/net/openvswitch/vport-netdev.c
@@ -75,6 +75,7 @@ static struct net_device *get_dpdev(const struct datapath *dp)
 
 struct vport *ovs_netdev_link(struct vport *vport, const char *name)
 {
+	struct nd_lock *nd_lock, *nd_lock2;
 	int err;
 
 	vport->dev = dev_get_by_name(ovs_dp_get_net(vport->dp), name);
@@ -99,9 +100,14 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name)
 	}
 
 	rtnl_lock();
+	double_lock_netdev(vport->dev, &nd_lock, get_dpdev(vport->dp), &nd_lock2);
+	nd_lock_transfer_devices(&nd_lock, &nd_lock2);
+
 	err = netdev_master_upper_dev_link(vport->dev,
 					   get_dpdev(vport->dp),
 					   NULL, NULL, NULL);
+	double_unlock_netdev(nd_lock, nd_lock2);
+
 	if (err)
 		goto error_unlock;
 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ