Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329120
b: refs/heads/master
c: 46a2f3b
h: refs/heads/master
v: v3
  • Loading branch information
Casey Schaufler committed Sep 18, 2012
1 parent 4630558 commit 8a01c76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 449543b0436a9146b855aad39eab76ae4853e88d
refs/heads/master: 46a2f3b9e99353cc63e15563e8abee71162330f7
14 changes: 2 additions & 12 deletions trunk/security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2684,9 +2684,7 @@ static int smack_getprocattr(struct task_struct *p, char *name, char **value)
static int smack_setprocattr(struct task_struct *p, char *name,
void *value, size_t size)
{
int rc;
struct task_smack *tsp;
struct task_smack *oldtsp;
struct cred *new;
char *newsmack;

Expand Down Expand Up @@ -2716,21 +2714,13 @@ static int smack_setprocattr(struct task_struct *p, char *name,
if (newsmack == smack_known_web.smk_known)
return -EPERM;

oldtsp = p->cred->security;
new = prepare_creds();
if (new == NULL)
return -ENOMEM;

tsp = new_task_smack(newsmack, oldtsp->smk_forked, GFP_KERNEL);
if (tsp == NULL) {
kfree(new);
return -ENOMEM;
}
rc = smk_copy_rules(&tsp->smk_rules, &oldtsp->smk_rules, GFP_KERNEL);
if (rc != 0)
return rc;
tsp = new->security;
tsp->smk_task = newsmack;

new->security = tsp;
commit_creds(new);
return size;
}
Expand Down

0 comments on commit 8a01c76

Please sign in to comment.