aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 14:43:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 14:43:54 -0500
commitbb26c6c29b7cc9f39e491b074b09f3c284738d36 (patch)
treec7867af2bb4ff0feae889183efcd4d79b0f9a325 /include/linux/sched.h
parente14e61e967f2b3bdf23f05e4ae5b9aa830151a44 (diff)
parentcbacc2c7f066a1e01b33b0e27ae5efbf534bc2db (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (105 commits) SELinux: don't check permissions for kernel mounts security: pass mount flags to security_sb_kern_mount() SELinux: correctly detect proc filesystems of the form "proc/foo" Audit: Log TIOCSTI user namespaces: document CFS behavior user namespaces: require cap_set{ug}id for CLONE_NEWUSER user namespaces: let user_ns be cloned with fairsched CRED: fix sparse warnings User namespaces: use the current_user_ns() macro User namespaces: set of cleanups (v2) nfsctl: add headers for credentials coda: fix creds reference capabilities: define get_vfs_caps_from_disk when file caps are not enabled CRED: Allow kernel services to override LSM settings for task actions CRED: Add a kernel_service object class to SELinux CRED: Differentiate objective and effective subjective credentials on a task CRED: Documentation CRED: Use creds in file structs CRED: Prettify commoncap.c CRED: Make execve() take advantage of copy-on-write credentials ...
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h65
1 files changed, 10 insertions, 55 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 55e30d114477..9624e2cfc2dc 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -572,12 +572,6 @@ struct signal_struct {
572 */ 572 */
573 struct rlimit rlim[RLIM_NLIMITS]; 573 struct rlimit rlim[RLIM_NLIMITS];
574 574
575 /* keep the process-shared keyrings here so that they do the right
576 * thing in threads created with CLONE_THREAD */
577#ifdef CONFIG_KEYS
578 struct key *session_keyring; /* keyring inherited over fork */
579 struct key *process_keyring; /* keyring private to this process */
580#endif
581#ifdef CONFIG_BSD_PROCESS_ACCT 575#ifdef CONFIG_BSD_PROCESS_ACCT
582 struct pacct_struct pacct; /* per-process accounting information */ 576 struct pacct_struct pacct; /* per-process accounting information */
583#endif 577#endif
@@ -648,6 +642,7 @@ struct user_struct {
648 /* Hash table maintenance information */ 642 /* Hash table maintenance information */
649 struct hlist_node uidhash_node; 643 struct hlist_node uidhash_node;
650 uid_t uid; 644 uid_t uid;
645 struct user_namespace *user_ns;
651 646
652#ifdef CONFIG_USER_SCHED 647#ifdef CONFIG_USER_SCHED
653 struct task_group *tg; 648 struct task_group *tg;
@@ -665,6 +660,7 @@ extern struct user_struct *find_user(uid_t);
665extern struct user_struct root_user; 660extern struct user_struct root_user;
666#define INIT_USER (&root_user) 661#define INIT_USER (&root_user)
667 662
663
668struct backing_dev_info; 664struct backing_dev_info;
669struct reclaim_state; 665struct reclaim_state;
670 666
@@ -888,38 +884,7 @@ partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
888#endif /* !CONFIG_SMP */ 884#endif /* !CONFIG_SMP */
889 885
890struct io_context; /* See blkdev.h */ 886struct io_context; /* See blkdev.h */
891#define NGROUPS_SMALL 32
892#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t)))
893struct group_info {
894 int ngroups;
895 atomic_t usage;
896 gid_t small_block[NGROUPS_SMALL];
897 int nblocks;
898 gid_t *blocks[0];
899};
900 887
901/*
902 * get_group_info() must be called with the owning task locked (via task_lock())
903 * when task != current. The reason being that the vast majority of callers are
904 * looking at current->group_info, which can not be changed except by the
905 * current task. Changing current->group_info requires the task lock, too.
906 */
907#define get_group_info(group_info) do { \
908 atomic_inc(&(group_info)->usage); \
909} while (0)
910
911#define put_group_info(group_info) do { \
912 if (atomic_dec_and_test(&(group_info)->usage)) \
913 groups_free(group_info); \
914} while (0)
915
916extern struct group_info *groups_alloc(int gidsetsize);
917extern void groups_free(struct group_info *group_info);
918extern int set_current_groups(struct group_info *group_info);
919extern int groups_search(struct group_info *group_info, gid_t grp);
920/* access the groups "array" with this macro */
921#define GROUP_AT(gi, i) \
922 ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK])
923 888
924#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK 889#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK
925extern void prefetch_stack(struct task_struct *t); 890extern void prefetch_stack(struct task_struct *t);
@@ -1186,17 +1151,12 @@ struct task_struct {
1186 struct list_head cpu_timers[3]; 1151 struct list_head cpu_timers[3];
1187 1152
1188/* process credentials */ 1153/* process credentials */
1189 uid_t uid,euid,suid,fsuid; 1154 const struct cred *real_cred; /* objective and real subjective task
1190 gid_t gid,egid,sgid,fsgid; 1155 * credentials (COW) */
1191 struct group_info *group_info; 1156 const struct cred *cred; /* effective (overridable) subjective task
1192 kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; 1157 * credentials (COW) */
1193 struct user_struct *user; 1158 struct mutex cred_exec_mutex; /* execve vs ptrace cred calculation mutex */
1194 unsigned securebits; 1159
1195#ifdef CONFIG_KEYS
1196 unsigned char jit_keyring; /* default keyring to attach requested keys to */
1197 struct key *request_key_auth; /* assumed request_key authority */
1198 struct key *thread_keyring; /* keyring private to this thread */
1199#endif
1200 char comm[TASK_COMM_LEN]; /* executable name excluding path 1160 char comm[TASK_COMM_LEN]; /* executable name excluding path
1201 - access with [gs]et_task_comm (which lock 1161 - access with [gs]et_task_comm (which lock
1202 it with task_lock()) 1162 it with task_lock())
@@ -1233,9 +1193,6 @@ struct task_struct {
1233 int (*notifier)(void *priv); 1193 int (*notifier)(void *priv);
1234 void *notifier_data; 1194 void *notifier_data;
1235 sigset_t *notifier_mask; 1195 sigset_t *notifier_mask;
1236#ifdef CONFIG_SECURITY
1237 void *security;
1238#endif
1239 struct audit_context *audit_context; 1196 struct audit_context *audit_context;
1240#ifdef CONFIG_AUDITSYSCALL 1197#ifdef CONFIG_AUDITSYSCALL
1241 uid_t loginuid; 1198 uid_t loginuid;
@@ -1775,7 +1732,6 @@ static inline struct user_struct *get_uid(struct user_struct *u)
1775 return u; 1732 return u;
1776} 1733}
1777extern void free_uid(struct user_struct *); 1734extern void free_uid(struct user_struct *);
1778extern void switch_uid(struct user_struct *);
1779extern void release_uids(struct user_namespace *ns); 1735extern void release_uids(struct user_namespace *ns);
1780 1736
1781#include <asm/current.h> 1737#include <asm/current.h>
@@ -1794,9 +1750,6 @@ extern void wake_up_new_task(struct task_struct *tsk,
1794extern void sched_fork(struct task_struct *p, int clone_flags); 1750extern void sched_fork(struct task_struct *p, int clone_flags);
1795extern void sched_dead(struct task_struct *p); 1751extern void sched_dead(struct task_struct *p);
1796 1752
1797extern int in_group_p(gid_t);
1798extern int in_egroup_p(gid_t);
1799
1800extern void proc_caches_init(void); 1753extern void proc_caches_init(void);
1801extern void flush_signals(struct task_struct *); 1754extern void flush_signals(struct task_struct *);
1802extern void ignore_signals(struct task_struct *); 1755extern void ignore_signals(struct task_struct *);
@@ -1928,6 +1881,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p,
1928#define for_each_process(p) \ 1881#define for_each_process(p) \
1929 for (p = &init_task ; (p = next_task(p)) != &init_task ; ) 1882 for (p = &init_task ; (p = next_task(p)) != &init_task ; )
1930 1883
1884extern bool is_single_threaded(struct task_struct *);
1885
1931/* 1886/*
1932 * Careful: do_each_thread/while_each_thread is a double loop so 1887 * Careful: do_each_thread/while_each_thread is a double loop so
1933 * 'break' will not work as expected - use goto instead. 1888 * 'break' will not work as expected - use goto instead.