]> git.baikalelectronics.ru Git - kernel.git/commit
encrypted-keys: fix rcu and sparse messages
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Tue, 17 Jan 2012 20:40:02 +0000 (20:40 +0000)
committerJames Morris <jmorris@namei.org>
Tue, 17 Jan 2012 23:41:30 +0000 (10:41 +1100)
commitf5c8f093dfd65349a3f2117ca16480e069e6cf3b
tree034c1a79a3d401926f6b968eb270d34f561e50f1
parent845f9d694cdc29627508d4b9760ee952665162c6
encrypted-keys: fix rcu and sparse messages

Enabling CONFIG_PROVE_RCU and CONFIG_SPARSE_RCU_POINTER resulted in
"suspicious rcu_dereference_check() usage!" and "incompatible types
in comparison expression (different address spaces)" messages.

Access the masterkey directly when holding the rwsem.

Changelog v1:
- Use either rcu_read_lock()/rcu_derefence_key()/rcu_read_unlock()
or remove the unnecessary rcu_derefence() - David Howells

Reported-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
security/keys/encrypted-keys/encrypted.c
security/keys/encrypted-keys/masterkey_trusted.c