aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/encrypted-keys
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.vnet.ibm.com>2012-01-17 15:39:51 -0500
committerJames Morris <jmorris@namei.org>2012-01-17 18:41:29 -0500
commitee0b31a25a010116f44fca6c96f4516d417793dd (patch)
treed7670d202d0f4888b5213ed73d88c9a80bd05b74 /security/keys/encrypted-keys
parentefde8b6e16f11e7d1681c68d86c7fd51053cada7 (diff)
keys: fix trusted/encrypted keys sparse rcu_assign_pointer messages
Define rcu_assign_keypointer(), which uses the key payload.rcudata instead of payload.data, to resolve the CONFIG_SPARSE_RCU_POINTER message: "incompatible types in comparison expression (different address spaces)" Replace the rcu_assign_pointer() calls in encrypted/trusted keys with rcu_assign_keypointer(). 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')
-rw-r--r--security/keys/encrypted-keys/encrypted.c4
-rw-r--r--security/keys/encrypted-keys/masterkey_trusted.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index 41144f71d615..d91efb6901e9 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -810,7 +810,7 @@ static int encrypted_instantiate(struct key *key, const void *data,
810 goto out; 810 goto out;
811 } 811 }
812 812
813 rcu_assign_pointer(key->payload.data, epayload); 813 rcu_assign_keypointer(key, epayload);
814out: 814out:
815 kfree(datablob); 815 kfree(datablob);
816 return ret; 816 return ret;
@@ -874,7 +874,7 @@ static int encrypted_update(struct key *key, const void *data, size_t datalen)
874 memcpy(new_epayload->payload_data, epayload->payload_data, 874 memcpy(new_epayload->payload_data, epayload->payload_data,
875 epayload->payload_datalen); 875 epayload->payload_datalen);
876 876
877 rcu_assign_pointer(key->payload.data, new_epayload); 877 rcu_assign_keypointer(key, new_epayload);
878 call_rcu(&epayload->rcu, encrypted_rcu_free); 878 call_rcu(&epayload->rcu, encrypted_rcu_free);
879out: 879out:
880 kfree(buf); 880 kfree(buf);
diff --git a/security/keys/encrypted-keys/masterkey_trusted.c b/security/keys/encrypted-keys/masterkey_trusted.c
index df87272e3f51..8c16c3e472e7 100644
--- a/security/keys/encrypted-keys/masterkey_trusted.c
+++ b/security/keys/encrypted-keys/masterkey_trusted.c
@@ -18,6 +18,8 @@
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/err.h> 19#include <linux/err.h>
20#include <keys/trusted-type.h> 20#include <keys/trusted-type.h>
21#include <keys/encrypted-type.h>
22#include "encrypted.h"
21 23
22/* 24/*
23 * request_trusted_key - request the trusted key 25 * request_trusted_key - request the trusted key