mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
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:
parent
15a2460ed0
commit
b6dff3ec5e
63 changed files with 830 additions and 675 deletions
|
@ -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(¤t->request_key_auth->sem);
|
||||
down_read(¤t->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,
|
||||
¤t->request_key_auth->flags))
|
||||
¤t->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(¤t->request_key_auth->sem);
|
||||
up_read(¤t->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(¤t->request_key_auth->sem);
|
||||
up_read(¤t->cred->request_key_auth->sem);
|
||||
kfree(rka->callout_info);
|
||||
kfree(rka);
|
||||
kleave("= -EKEYREVOKED");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue