aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/Kconfig3
-rw-r--r--kernel/capability.c1
-rw-r--r--kernel/cred-internals.h21
-rw-r--r--kernel/cred.c3
-rw-r--r--kernel/exit.c1
-rw-r--r--kernel/sched_debug.c5
-rw-r--r--kernel/user.c10
7 files changed, 2 insertions, 42 deletions
diff --git a/init/Kconfig b/init/Kconfig
index eb77e8ccde1c..5fe94b82e4c0 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -604,8 +604,7 @@ config RT_GROUP_SCHED
604 default n 604 default n
605 help 605 help
606 This feature lets you explicitly allocate real CPU bandwidth 606 This feature lets you explicitly allocate real CPU bandwidth
607 to users or control groups (depending on the "Basis for grouping tasks" 607 to task groups. If enabled, it will also make it impossible to
608 setting below. If enabled, it will also make it impossible to
609 schedule realtime tasks for non-root users until you allocate 608 schedule realtime tasks for non-root users until you allocate
610 realtime bandwidth for them. 609 realtime bandwidth for them.
611 See Documentation/scheduler/sched-rt-group.txt for more information. 610 See Documentation/scheduler/sched-rt-group.txt for more information.
diff --git a/kernel/capability.c b/kernel/capability.c
index 9e4697e9b276..2f05303715a5 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -15,7 +15,6 @@
15#include <linux/syscalls.h> 15#include <linux/syscalls.h>
16#include <linux/pid_namespace.h> 16#include <linux/pid_namespace.h>
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include "cred-internals.h"
19 18
20/* 19/*
21 * Leveraged for setting/resetting capabilities 20 * Leveraged for setting/resetting capabilities
diff --git a/kernel/cred-internals.h b/kernel/cred-internals.h
deleted file mode 100644
index 2dc4fc2d0bf1..000000000000
--- a/kernel/cred-internals.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* Internal credentials stuff
2 *
3 * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12/*
13 * user.c
14 */
15static inline void sched_switch_user(struct task_struct *p)
16{
17#ifdef CONFIG_USER_SCHED
18 sched_move_task(p);
19#endif /* CONFIG_USER_SCHED */
20}
21
diff --git a/kernel/cred.c b/kernel/cred.c
index 1b1129d0cce8..19d3ccce3d4d 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -16,7 +16,6 @@
16#include <linux/init_task.h> 16#include <linux/init_task.h>
17#include <linux/security.h> 17#include <linux/security.h>
18#include <linux/cn_proc.h> 18#include <linux/cn_proc.h>
19#include "cred-internals.h"
20 19
21#if 0 20#if 0
22#define kdebug(FMT, ...) \ 21#define kdebug(FMT, ...) \
@@ -557,8 +556,6 @@ int commit_creds(struct cred *new)
557 atomic_dec(&old->user->processes); 556 atomic_dec(&old->user->processes);
558 alter_cred_subscribers(old, -2); 557 alter_cred_subscribers(old, -2);
559 558
560 sched_switch_user(task);
561
562 /* send notifications */ 559 /* send notifications */
563 if (new->uid != old->uid || 560 if (new->uid != old->uid ||
564 new->euid != old->euid || 561 new->euid != old->euid ||
diff --git a/kernel/exit.c b/kernel/exit.c
index cce59cb5ee6a..84dc4b294e47 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -55,7 +55,6 @@
55#include <asm/unistd.h> 55#include <asm/unistd.h>
56#include <asm/pgtable.h> 56#include <asm/pgtable.h>
57#include <asm/mmu_context.h> 57#include <asm/mmu_context.h>
58#include "cred-internals.h"
59 58
60static void exit_mm(struct task_struct * tsk); 59static void exit_mm(struct task_struct * tsk);
61 60
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 8a46a719f367..0932c5c45b34 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -173,11 +173,6 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
173 task_group_path(tg, path, sizeof(path)); 173 task_group_path(tg, path, sizeof(path));
174 174
175 SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path); 175 SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
176#elif defined(CONFIG_USER_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
177 {
178 uid_t uid = cfs_rq->tg->uid;
179 SEQ_printf(m, "\ncfs_rq[%d] for UID: %u\n", cpu, uid);
180 }
181#else 176#else
182 SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu); 177 SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
183#endif 178#endif
diff --git a/kernel/user.c b/kernel/user.c
index ec3b2229893b..8e1c8c0a496c 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -16,7 +16,6 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/user_namespace.h> 18#include <linux/user_namespace.h>
19#include "cred-internals.h"
20 19
21struct user_namespace init_user_ns = { 20struct user_namespace init_user_ns = {
22 .kref = { 21 .kref = {
@@ -137,9 +136,7 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
137 struct hlist_head *hashent = uidhashentry(ns, uid); 136 struct hlist_head *hashent = uidhashentry(ns, uid);
138 struct user_struct *up, *new; 137 struct user_struct *up, *new;
139 138
140 /* Make uid_hash_find() + uids_user_create() + uid_hash_insert() 139 /* Make uid_hash_find() + uid_hash_insert() atomic. */
141 * atomic.
142 */
143 spin_lock_irq(&uidhash_lock); 140 spin_lock_irq(&uidhash_lock);
144 up = uid_hash_find(uid, hashent); 141 up = uid_hash_find(uid, hashent);
145 spin_unlock_irq(&uidhash_lock); 142 spin_unlock_irq(&uidhash_lock);
@@ -161,11 +158,6 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
161 spin_lock_irq(&uidhash_lock); 158 spin_lock_irq(&uidhash_lock);
162 up = uid_hash_find(uid, hashent); 159 up = uid_hash_find(uid, hashent);
163 if (up) { 160 if (up) {
164 /* This case is not possible when CONFIG_USER_SCHED
165 * is defined, since we serialize alloc_uid() using
166 * uids_mutex. Hence no need to call
167 * sched_destroy_user() or remove_user_sysfs_dir().
168 */
169 key_put(new->uid_keyring); 161 key_put(new->uid_keyring);
170 key_put(new->session_keyring); 162 key_put(new->session_keyring);
171 kmem_cache_free(uid_cachep, new); 163 kmem_cache_free(uid_cachep, new);