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-next>] [day] [month] [year] [list]
Message-ID: <20160325173032.GC29822@localhost>
Date:	Fri, 25 Mar 2016 12:30:32 -0500
From:	Bjorn Helgaas <helgaas@...nel.org>
To:	Neil Horman <nhorman@...hat.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
	netdev@...r.kernel.org, Alexander Duyck <aduyck@...antis.com>,
	linux-kernel@...r.kernel.org
Subject: netpoll rtnl_dereference() usage

Hi Neil,

Since we're looking at netpoll, here's another question (or two).
0790bbb68f9d ("netpoll: cleanup sparse warnings") adds this:

@@ -1236,7 +1236,11 @@ void __netpoll_cleanup(struct netpoll *np)
        struct netpoll_info *npinfo;
        unsigned long flags;
 
-       npinfo = np->dev->npinfo;
+       /* rtnl_dereference would be preferable here but
+        * rcu_cleanup_netpoll path can put us in here safely without
+        * holding the rtnl, so plain rcu_dereference it is
+        */
+       npinfo = rtnl_dereference(np->dev->npinfo);
        if (!npinfo)
                return;

The comment seems to contradict the code: the comment says "we would
like to use rtnl_dereference(), but we have to use rcu_dereference()."
But the code in fact *does* use rtnl_dereference().

Also, "rcu_cleanup_netpoll" doesn't exist; maybe it's a typo for
rcu_cleanup_netpoll_info()?  I don't see the path that leads from
rcu_cleanup_netpoll_info() to __netpoll_cleanup(), but I don't claim
to understand the netpoll async subtleties.

Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ