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>
This commit is contained in:
David Howells 2008-11-14 10:39:16 +11:00 committed by James Morris
parent 15a2460ed0
commit b6dff3ec5e
63 changed files with 830 additions and 675 deletions

View file

@ -164,22 +164,22 @@ struct key *request_key_auth_new(struct key *target, const void *callout_info,
/* see if the calling process is already servicing the key request of
* another process */
if (current->request_key_auth) {
if (current->cred->request_key_auth) {
/* it is - use that instantiation context here too */
down_read(&current->request_key_auth->sem);
down_read(&current->cred->request_key_auth->sem);
/* if the auth key has been revoked, then the key we're
* servicing is already instantiated */
if (test_bit(KEY_FLAG_REVOKED,
&current->request_key_auth->flags))
&current->cred->request_key_auth->flags))
goto auth_key_revoked;
irka = current->request_key_auth->payload.data;
irka = current->cred->request_key_auth->payload.data;
rka->context = irka->context;
rka->pid = irka->pid;
get_task_struct(rka->context);
up_read(&current->request_key_auth->sem);
up_read(&current->cred->request_key_auth->sem);
}
else {
/* 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,
return authkey;
auth_key_revoked:
up_read(&current->request_key_auth->sem);
up_read(&current->cred->request_key_auth->sem);
kfree(rka->callout_info);
kfree(rka);
kleave("= -EKEYREVOKED");