keys: sparse: Fix incorrect RCU accesses
authorDavid Howells <dhowells@redhat.com>
Wed, 22 May 2019 13:09:29 +0000 (14:09 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 29 May 2019 21:32:05 +0000 (22:32 +0100)
commit7936d16df9a56c993c23385ea9c2785127f81711
treed86542e699dc8b41a70c214369dda8f6bbdd8063
parent2e21865faf4fd7ca99eb2ace072c6d618059e342
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>
security/keys/keyctl.c
security/keys/request_key_auth.c