aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cred.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cred.c')
-rw-r--r--kernel/cred.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/cred.c b/kernel/cred.c
index e1dbe9eef800..8f3672a58a1e 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -17,7 +17,6 @@
17#include <linux/init_task.h> 17#include <linux/init_task.h>
18#include <linux/security.h> 18#include <linux/security.h>
19#include <linux/cn_proc.h> 19#include <linux/cn_proc.h>
20#include "cred-internals.h"
21 20
22#if 0 21#if 0
23#define kdebug(FMT, ...) \ 22#define kdebug(FMT, ...) \
@@ -398,6 +397,8 @@ struct cred *prepare_usermodehelper_creds(void)
398 397
399error: 398error:
400 put_cred(new); 399 put_cred(new);
400 return NULL;
401
401free_tgcred: 402free_tgcred:
402#ifdef CONFIG_KEYS 403#ifdef CONFIG_KEYS
403 kfree(tgcred); 404 kfree(tgcred);
@@ -558,8 +559,6 @@ int commit_creds(struct cred *new)
558 atomic_dec(&old->user->processes); 559 atomic_dec(&old->user->processes);
559 alter_cred_subscribers(old, -2); 560 alter_cred_subscribers(old, -2);
560 561
561 sched_switch_user(task);
562
563 /* send notifications */ 562 /* send notifications */
564 if (new->uid != old->uid || 563 if (new->uid != old->uid ||
565 new->euid != old->euid || 564 new->euid != old->euid ||
@@ -791,8 +790,6 @@ bool creds_are_invalid(const struct cred *cred)
791{ 790{
792 if (cred->magic != CRED_MAGIC) 791 if (cred->magic != CRED_MAGIC)
793 return true; 792 return true;
794 if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers))
795 return true;
796#ifdef CONFIG_SECURITY_SELINUX 793#ifdef CONFIG_SECURITY_SELINUX
797 if (selinux_is_enabled()) { 794 if (selinux_is_enabled()) {
798 if ((unsigned long) cred->security < PAGE_SIZE) 795 if ((unsigned long) cred->security < PAGE_SIZE)