diff options
author | David Howells <dhowells@redhat.com> | 2019-05-22 15:09:29 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2019-05-29 23:32:05 +0200 |
commit | 7936d16df9a56c993c23385ea9c2785127f81711 (patch) | |
tree | d86542e699dc8b41a70c214369dda8f6bbdd8063 /security/keys/request_key_auth.c | |
parent | keys: sparse: Fix key_fs[ug]id_changed() (diff) | |
download | linux-7936d16df9a56c993c23385ea9c2785127f81711.tar.xz linux-7936d16df9a56c993c23385ea9c2785127f81711.zip |
keys: sparse: Fix incorrect RCU accesses
Fix a pair of accesses that should be using RCU protection.
rcu_dereference_protected() is needed to access task_struct::real_parent.
current_cred() should be used to access current->cred.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Diffstat (limited to '')
-rw-r--r-- | security/keys/request_key_auth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c index bda6201c6c45..572c7a60473a 100644 --- a/security/keys/request_key_auth.c +++ b/security/keys/request_key_auth.c @@ -152,7 +152,7 @@ struct key *request_key_auth_new(struct key *target, const char *op, struct key *dest_keyring) { struct request_key_auth *rka, *irka; - const struct cred *cred = current->cred; + const struct cred *cred = current_cred(); struct key *authkey = NULL; char desc[20]; int ret = -ENOMEM; |