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] [day] [month] [year] [list]
Date:	Wed, 07 Apr 2010 18:35:38 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Howells <dhowells@...hat.com>
Cc:	paulmck@...ux.vnet.ibm.com, Trond.Myklebust@...app.com,
	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] rcu: add rcu_access_pointer and
 rcu_dereference_protect

Le mercredi 07 avril 2010 à 17:19 +0100, David Howells a écrit :

> what is the value of sk->sk_wmem_alloc to the lock context of sk->sk_filter?
> Why would lockdep be interested in sk_wmem_alloc?
> 
> Surely, the assertion that the value of sk->sk_filter is related to
> sk_wmem_alloc being 0 is independent of the need to dereference sk_filter for
> RCU purposes.  So why are these being combined?

Because when sk->sk_filter is eventually written by some thread, this
thread _must_ own a reference on the socket, that is sk_wmem_alloc > 0

So when reading sk->sk_filter, the general condition is : 
- We own the rcu lock 
- But on the particular case of __sk_free(),
  we owned the very last reference to sk (we are going to kfree it), so
nobody can possibly change sk->sk_filter under us.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ