diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/keys/encrypted.c | 3 | ||||
-rw-r--r-- | security/keys/trusted.c | 3 | ||||
-rw-r--r-- | security/keys/user_defined.c | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/security/keys/encrypted.c b/security/keys/encrypted.c index 9e7e4ce3fae8..69907a58a683 100644 --- a/security/keys/encrypted.c +++ b/security/keys/encrypted.c | |||
@@ -765,8 +765,7 @@ static long encrypted_read(const struct key *key, char __user *buffer, | |||
765 | size_t asciiblob_len; | 765 | size_t asciiblob_len; |
766 | int ret; | 766 | int ret; |
767 | 767 | ||
768 | epayload = rcu_dereference_protected(key->payload.data, | 768 | epayload = rcu_dereference_key(key); |
769 | rwsem_is_locked(&((struct key *)key)->sem)); | ||
770 | 769 | ||
771 | /* returns the hex encoded iv, encrypted-data, and hmac as ascii */ | 770 | /* returns the hex encoded iv, encrypted-data, and hmac as ascii */ |
772 | asciiblob_len = epayload->datablob_len + ivsize + 1 | 771 | asciiblob_len = epayload->datablob_len + ivsize + 1 |
diff --git a/security/keys/trusted.c b/security/keys/trusted.c index 83fc92e297cd..c99b9368368c 100644 --- a/security/keys/trusted.c +++ b/security/keys/trusted.c | |||
@@ -1076,8 +1076,7 @@ static long trusted_read(const struct key *key, char __user *buffer, | |||
1076 | char *bufp; | 1076 | char *bufp; |
1077 | int i; | 1077 | int i; |
1078 | 1078 | ||
1079 | p = rcu_dereference_protected(key->payload.data, | 1079 | p = rcu_dereference_key(key); |
1080 | rwsem_is_locked(&((struct key *)key)->sem)); | ||
1081 | if (!p) | 1080 | if (!p) |
1082 | return -EINVAL; | 1081 | return -EINVAL; |
1083 | if (!buffer || buflen <= 0) | 1082 | if (!buffer || buflen <= 0) |
diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c index 02807fb16340..c6ca8662a468 100644 --- a/security/keys/user_defined.c +++ b/security/keys/user_defined.c | |||
@@ -184,8 +184,7 @@ long user_read(const struct key *key, char __user *buffer, size_t buflen) | |||
184 | struct user_key_payload *upayload; | 184 | struct user_key_payload *upayload; |
185 | long ret; | 185 | long ret; |
186 | 186 | ||
187 | upayload = rcu_dereference_protected( | 187 | upayload = rcu_dereference_key(key); |
188 | key->payload.data, rwsem_is_locked(&((struct key *)key)->sem)); | ||
189 | ret = upayload->datalen; | 188 | ret = upayload->datalen; |
190 | 189 | ||
191 | /* we can return the data as is */ | 190 | /* we can return the data as is */ |