aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/proc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-06-19 16:10:15 +0100
committerDavid Howells <dhowells@redhat.com>2019-06-19 16:10:15 +0100
commite59428f721ee096d8a020504ea908a6f0d952735 (patch)
tree4efe82c08f4a65a5a8834a7b75f831569e03c3ba /security/keys/proc.c
parentkeys: Invalidate used request_key authentication keys (diff)
downloadlinux-dev-e59428f721ee096d8a020504ea908a6f0d952735.tar.xz
linux-dev-e59428f721ee096d8a020504ea908a6f0d952735.zip
keys: Move the RCU locks outwards from the keyring search functions
Move the RCU locks outwards from the keyring search functions so that it will become possible to provide an RCU-capable partial request_key() function in a later commit. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'security/keys/proc.c')
-rw-r--r--security/keys/proc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/keys/proc.c b/security/keys/proc.c
index 78ac305d715e..f081dceae3b9 100644
--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -179,7 +179,9 @@ static int proc_keys_show(struct seq_file *m, void *v)
* skip if the key does not indicate the possessor can view it
*/
if (key->perm & KEY_POS_VIEW) {
- skey_ref = search_my_process_keyrings(&ctx);
+ rcu_read_lock();
+ skey_ref = search_cred_keyrings_rcu(&ctx);
+ rcu_read_unlock();
if (!IS_ERR(skey_ref)) {
key_ref_put(skey_ref);
key_ref = make_key_ref(key, 1);