diff options
Diffstat (limited to 'security/keys')
-rw-r--r-- | security/keys/internal.h | 1 | ||||
-rw-r--r-- | security/keys/process_keys.c | 2 | ||||
-rw-r--r-- | security/keys/request_key.c | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/security/keys/internal.h b/security/keys/internal.h index b39f5c2e2c4b..239098f0fd76 100644 --- a/security/keys/internal.h +++ b/security/keys/internal.h | |||
@@ -107,6 +107,7 @@ extern key_ref_t search_process_keyrings(struct key_type *type, | |||
107 | 107 | ||
108 | extern struct key *find_keyring_by_name(const char *name, bool skip_perm_check); | 108 | extern struct key *find_keyring_by_name(const char *name, bool skip_perm_check); |
109 | 109 | ||
110 | extern int install_user_keyrings(struct task_struct *tsk); | ||
110 | extern int install_thread_keyring(struct task_struct *tsk); | 111 | extern int install_thread_keyring(struct task_struct *tsk); |
111 | extern int install_process_keyring(struct task_struct *tsk); | 112 | extern int install_process_keyring(struct task_struct *tsk); |
112 | 113 | ||
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c index 5be6d018759a..45b240af6dbe 100644 --- a/security/keys/process_keys.c +++ b/security/keys/process_keys.c | |||
@@ -40,7 +40,7 @@ struct key_user root_key_user = { | |||
40 | /* | 40 | /* |
41 | * install user and user session keyrings for a particular UID | 41 | * install user and user session keyrings for a particular UID |
42 | */ | 42 | */ |
43 | static int install_user_keyrings(struct task_struct *tsk) | 43 | int install_user_keyrings(struct task_struct *tsk) |
44 | { | 44 | { |
45 | struct user_struct *user = tsk->user; | 45 | struct user_struct *user = tsk->user; |
46 | struct key *uid_keyring, *session_keyring; | 46 | struct key *uid_keyring, *session_keyring; |
diff --git a/security/keys/request_key.c b/security/keys/request_key.c index ba32ca6469bd..abea08f87fe2 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c | |||
@@ -74,6 +74,10 @@ static int call_sbin_request_key(struct key_construction *cons, | |||
74 | 74 | ||
75 | kenter("{%d},{%d},%s", key->serial, authkey->serial, op); | 75 | kenter("{%d},{%d},%s", key->serial, authkey->serial, op); |
76 | 76 | ||
77 | ret = install_user_keyrings(tsk); | ||
78 | if (ret < 0) | ||
79 | goto error_alloc; | ||
80 | |||
77 | /* allocate a new session keyring */ | 81 | /* allocate a new session keyring */ |
78 | sprintf(desc, "_req.%u", key->serial); | 82 | sprintf(desc, "_req.%u", key->serial); |
79 | 83 | ||