diff options
author | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2012-01-17 15:40:02 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2012-01-17 18:41:30 -0500 |
commit | 6ac6172a935d1faf7ef259802267657bc0007a62 (patch) | |
tree | 034c1a79a3d401926f6b968eb270d34f561e50f1 /security/keys/encrypted-keys/masterkey_trusted.c | |
parent | ee0b31a25a010116f44fca6c96f4516d417793dd (diff) |
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>
Diffstat (limited to 'security/keys/encrypted-keys/masterkey_trusted.c')
-rw-r--r-- | security/keys/encrypted-keys/masterkey_trusted.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/keys/encrypted-keys/masterkey_trusted.c b/security/keys/encrypted-keys/masterkey_trusted.c index 8c16c3e472e7..013f7e5d3a2f 100644 --- a/security/keys/encrypted-keys/masterkey_trusted.c +++ b/security/keys/encrypted-keys/masterkey_trusted.c | |||
@@ -39,7 +39,7 @@ struct key *request_trusted_key(const char *trusted_desc, | |||
39 | goto error; | 39 | goto error; |
40 | 40 | ||
41 | down_read(&tkey->sem); | 41 | down_read(&tkey->sem); |
42 | tpayload = rcu_dereference(tkey->payload.data); | 42 | tpayload = tkey->payload.data; |
43 | *master_key = tpayload->key; | 43 | *master_key = tpayload->key; |
44 | *master_keylen = tpayload->key_len; | 44 | *master_keylen = tpayload->key_len; |
45 | error: | 45 | error: |