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: <AE90C24D6B3A694183C094C60CF0A2F6026B7441@saturn3.aculab.com>
Date:	Mon, 25 Nov 2013 09:40:08 -0000
From:	"David Laight" <David.Laight@...LAB.COM>
To:	"Nicholas Mc Guire" <der.herr@...r.at>,
	"David Miller" <davem@...emloft.net>
Cc:	<kuznet@....inr.ac.ru>, <eric.dumazet@...il.com>,
	<roque@...fc.ul.pt>, <peterz@...radead.org>,
	<netdev@...r.kernel.org>
Subject: RE: [PATCH] rebalance locks by converting write_lock_bh towrite_lock+local_bh_disable

> in one of the cases I do not understand the intent behind the split:
> in net/core/sock.c:lock_sock_fast
> 
> 	spin_lock_bh(&sk->sk_lock.slock);
> 	...
>         spin_unlock(&sk->sk_lock.slock);
>         /*
>          * The sk_lock has mutex_lock() semantics here:
>          */
>         mutex_acquire(&sk->sk_lock.dep_map, 0, 0, _RET_IP_);
>         local_bh_enable();
> 
>  I think that
> 
> 	spin_lock_bh(&sk->sk_lock.slock);
> 	...
>         /*
>          * The sk_lock has mutex_lock() semantics here:
>          */
>         mutex_acquire(&sk->sk_lock.dep_map, 0, 0, _RET_IP_);
>         spin_unlock_bh(&sk->sk_lock.slock);
> 
>  should be equivalent ?

You've added a lock ordering that wasn't there before.
Also I suspect that mutex_acquire() might be allowed to sleep,
whereas you shouldn't sleep with a spin lock held.

	David



--
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