diff options
author | David Howells <dhowells@redhat.com> | 2008-11-13 18:39:16 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-11-13 18:39:16 -0500 |
commit | b6dff3ec5e116e3af6f537d4caedcad6b9e5082a (patch) | |
tree | 9e76f972eb7ce9b84e0146c8e4126a3f86acb428 /security/keys/request_key_auth.c | |
parent | 15a2460ed0af7538ca8e6c610fe607a2cd9da142 (diff) |
CRED: Separate task security context from task_struct
Separate the task security context from task_struct. At this point, the
security data is temporarily embedded in the task_struct with two pointers
pointing to it.
Note that the Alpha arch is altered as it refers to (E)UID and (E)GID in
entry.S via asm-offsets.
With comment fixes Signed-off-by: Marc Dionne <marc.c.dionne@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/keys/request_key_auth.c')
-rw-r--r-- | security/keys/request_key_auth.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c index 1762d44711d5..2125579d5d73 100644 --- a/security/keys/request_key_auth.c +++ b/security/keys/request_key_auth.c | |||
@@ -164,22 +164,22 @@ struct key *request_key_auth_new(struct key *target, const void *callout_info, | |||
164 | 164 | ||
165 | /* see if the calling process is already servicing the key request of | 165 | /* see if the calling process is already servicing the key request of |
166 | * another process */ | 166 | * another process */ |
167 | if (current->request_key_auth) { | 167 | if (current->cred->request_key_auth) { |
168 | /* it is - use that instantiation context here too */ | 168 | /* it is - use that instantiation context here too */ |
169 | down_read(¤t->request_key_auth->sem); | 169 | down_read(¤t->cred->request_key_auth->sem); |
170 | 170 | ||
171 | /* if the auth key has been revoked, then the key we're | 171 | /* if the auth key has been revoked, then the key we're |
172 | * servicing is already instantiated */ | 172 | * servicing is already instantiated */ |
173 | if (test_bit(KEY_FLAG_REVOKED, | 173 | if (test_bit(KEY_FLAG_REVOKED, |
174 | ¤t->request_key_auth->flags)) | 174 | ¤t->cred->request_key_auth->flags)) |
175 | goto auth_key_revoked; | 175 | goto auth_key_revoked; |
176 | 176 | ||
177 | irka = current->request_key_auth->payload.data; | 177 | irka = current->cred->request_key_auth->payload.data; |
178 | rka->context = irka->context; | 178 | rka->context = irka->context; |
179 | rka->pid = irka->pid; | 179 | rka->pid = irka->pid; |
180 | get_task_struct(rka->context); | 180 | get_task_struct(rka->context); |
181 | 181 | ||
182 | up_read(¤t->request_key_auth->sem); | 182 | up_read(¤t->cred->request_key_auth->sem); |
183 | } | 183 | } |
184 | else { | 184 | else { |
185 | /* it isn't - use this process as the context */ | 185 | /* it isn't - use this process as the context */ |
@@ -214,7 +214,7 @@ struct key *request_key_auth_new(struct key *target, const void *callout_info, | |||
214 | return authkey; | 214 | return authkey; |
215 | 215 | ||
216 | auth_key_revoked: | 216 | auth_key_revoked: |
217 | up_read(¤t->request_key_auth->sem); | 217 | up_read(¤t->cred->request_key_auth->sem); |
218 | kfree(rka->callout_info); | 218 | kfree(rka->callout_info); |
219 | kfree(rka); | 219 | kfree(rka); |
220 | kleave("= -EKEYREVOKED"); | 220 | kleave("= -EKEYREVOKED"); |