aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorCedric Le Goater <clg@fr.ibm.com>2007-07-16 02:40:59 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:47 -0400
commitacce292c82d4d82d35553b928df2b0597c3a9c78 (patch)
tree464288f40db9c254da214c400d0880ee50dc37f3 /include/linux/sched.h
parent7d69a1f4a72b18876c99c697692b78339d491568 (diff)
user namespace: add the framework
Basically, it will allow a process to unshare its user_struct table, resetting at the same time its own user_struct and all the associated accounting. A new root user (uid == 0) is added to the user namespace upon creation. Such root users have full privileges and it seems that theses privileges should be controlled through some means (process capabilities ?) The unshare is not included in this patch. Changes since [try #4]: - Updated get_user_ns and put_user_ns to accept NULL, and get_user_ns to return the namespace. Changes since [try #3]: - moved struct user_namespace to files user_namespace.{c,h} Changes since [try #2]: - removed struct user_namespace* argument from find_user() Changes since [try #1]: - removed struct user_namespace* argument from find_user() - added a root_user per user namespace Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Signed-off-by: Serge E. Hallyn <serue@us.ibm.com> Acked-by: Pavel Emelianov <xemul@openvz.org> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Kirill Korotaev <dev@sw.ru> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Chris Wright <chrisw@sous-sol.org> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: James Morris <jmorris@namei.org> Cc: Andrew Morgan <agm@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b579624477f4..c667255d70db 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -287,6 +287,7 @@ extern signed long schedule_timeout_uninterruptible(signed long timeout);
287asmlinkage void schedule(void); 287asmlinkage void schedule(void);
288 288
289struct nsproxy; 289struct nsproxy;
290struct user_namespace;
290 291
291/* Maximum number of active map areas.. This is a random (large) number */ 292/* Maximum number of active map areas.. This is a random (large) number */
292#define DEFAULT_MAX_MAP_COUNT 65536 293#define DEFAULT_MAX_MAP_COUNT 65536
@@ -1408,7 +1409,7 @@ extern struct task_struct *find_task_by_pid_type(int type, int pid);
1408extern void __set_special_pids(pid_t session, pid_t pgrp); 1409extern void __set_special_pids(pid_t session, pid_t pgrp);
1409 1410
1410/* per-UID process charging. */ 1411/* per-UID process charging. */
1411extern struct user_struct * alloc_uid(uid_t); 1412extern struct user_struct * alloc_uid(struct user_namespace *, uid_t);
1412static inline struct user_struct *get_uid(struct user_struct *u) 1413static inline struct user_struct *get_uid(struct user_struct *u)
1413{ 1414{
1414 atomic_inc(&u->__count); 1415 atomic_inc(&u->__count);