From 8a01c761064f8527ad68f1902c4e70ae63db7ef9 Mon Sep 17 00:00:00 2001 From: Casey Schaufler Date: Wed, 22 Aug 2012 11:44:03 -0700 Subject: [PATCH] --- yaml --- r: 329120 b: refs/heads/master c: 46a2f3b9e99353cc63e15563e8abee71162330f7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/security/smack/smack_lsm.c | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index fc9e71b3af8f..8b45fbbe6a73 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 449543b0436a9146b855aad39eab76ae4853e88d +refs/heads/master: 46a2f3b9e99353cc63e15563e8abee71162330f7 diff --git a/trunk/security/smack/smack_lsm.c b/trunk/security/smack/smack_lsm.c index ce9273a18165..2874c7316783 100644 --- a/trunk/security/smack/smack_lsm.c +++ b/trunk/security/smack/smack_lsm.c @@ -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; @@ -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; }