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: <152234044431.19153.15864418521565135021.stgit@localhost.localdomain>
Date:   Thu, 29 Mar 2018 19:20:44 +0300
From:   Kirill Tkhai <ktkhai@...tuozzo.com>
To:     dledford@...hat.com, jgg@...pe.ca, davem@...emloft.net,
        pablo@...filter.org, kadlec@...ckhole.kfki.hu, fw@...len.de,
        pshelar@....org, johannes@...solutions.net, paul@...l-moore.com,
        sds@...ho.nsa.gov, eparis@...isplace.org, jmorris@...ei.org,
        serge@...lyn.com, leon@...nel.org, yuval.shaia@...cle.com,
        parav@...lanox.com, danielj@...lanox.com, ktkhai@...tuozzo.com,
        majd@...lanox.com, nicolas.dichtel@...nd.com, vyasevic@...hat.com,
        paulmck@...ux.vnet.ibm.com, vyasevich@...il.com,
        gregkh@...uxfoundation.org, daniel@...earbox.net,
        jakub.kicinski@...ronome.com, ast@...nel.org, brouer@...hat.com,
        linux@...musvillemoes.dk, john.fastabend@...il.com,
        dsahern@...il.com, jiri@...lanox.com, idosch@...lanox.com,
        vvs@...tuozzo.com, avagin@...tuozzo.com, roman.kapl@...go.com,
        lucien.xin@...il.com, christian.brauner@...ntu.com,
        jbenc@...hat.com, pombredanne@...b.com, linux-rdma@...r.kernel.org,
        netdev@...r.kernel.org, netfilter-devel@...r.kernel.org,
        coreteam@...filter.org, dev@...nvswitch.org,
        linux-wireless@...r.kernel.org, selinux@...ho.nsa.gov,
        linux-security-module@...r.kernel.org
Subject: [PATCH net-next 2/5] net: Don't take rtnl_lock() in
 wireless_nlevent_flush()

This function iterates over net_namespace_list and flushes
the queue for every of them. What does this rtnl_lock()
protects?! Since we may add skbs to net::wext_nlevents
without rtnl_lock(), it does not protects us about queuers.

It guarantees, two threads can't flush the queue in parallel,
that can change the order, but since skb can be queued
in any order, it doesn't matter, how many threads do this
in parallel. In case of several threads, this will be even
faster.

So, we can remove rtnl_lock() here, as it was used for
iteration over net_namespace_list only.

Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
---
 net/wireless/wext-core.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
index 544d7b62d7ca..5e677dac2a0c 100644
--- a/net/wireless/wext-core.c
+++ b/net/wireless/wext-core.c
@@ -347,8 +347,6 @@ void wireless_nlevent_flush(void)
 	struct sk_buff *skb;
 	struct net *net;
 
-	ASSERT_RTNL();
-
 	down_read(&net_rwsem);
 	for_each_net(net) {
 		while ((skb = skb_dequeue(&net->wext_nlevents)))
@@ -412,9 +410,7 @@ subsys_initcall(wireless_nlevent_init);
 /* Process events generated by the wireless layer or the driver. */
 static void wireless_nlevent_process(struct work_struct *work)
 {
-	rtnl_lock();
 	wireless_nlevent_flush();
-	rtnl_unlock();
 }
 
 static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ