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: <20091111093927.4a08999d@nehalam>
Date:	Wed, 11 Nov 2009 09:39:27 -0800
From:	Stephen Hemminger <shemminger@...tta.com>
To:	steve@...gwyn.com, David Miller <davem@...emloft.net>
Cc:	Eric Dumazet <eric.dumazet@...il.com>,
	Christine Caulfield <christine.caulfield@...glemail.com>,
	Hannes Eder <hannes@...neseder.net>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Steven Whitehouse <swhiteho@...hat.com>,
	netdev@...r.kernel.org, linux-decnet-users@...ts.sourceforge.net
Subject: [PATCH 1/2] decnet: add RTNL lock when reading address list

Add missing locking in the case of auto binding to the
default device. The address list might change while this code is looking
at the list. 

Compile tested only, I am not a decnet user.

Signed-off-by: Stephen Hemminger <shemminger@...tta.com>

--- a/net/decnet/dn_dev.c	2009-11-11 09:18:02.935313559 -0800
+++ b/net/decnet/dn_dev.c	2009-11-11 09:22:32.157313924 -0800
@@ -828,13 +828,17 @@ static int dn_dev_get_first(struct net_d
 	struct dn_dev *dn_db = (struct dn_dev *)dev->dn_ptr;
 	struct dn_ifaddr *ifa;
 	int rv = -ENODEV;
+
 	if (dn_db == NULL)
 		goto out;
+
+	rtnl_lock();
 	ifa = dn_db->ifa_list;
 	if (ifa != NULL) {
 		*addr = ifa->ifa_local;
 		rv = 0;
 	}
+	rtnl_unlock();
 out:
 	return rv;
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ