aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index f6083561dfe0..81fdc7733908 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -147,8 +147,8 @@ void __put_task_struct(struct task_struct *tsk)
147 WARN_ON(tsk == current); 147 WARN_ON(tsk == current);
148 148
149 security_task_free(tsk); 149 security_task_free(tsk);
150 free_uid(tsk->user); 150 free_uid(tsk->__temp_cred.user);
151 put_group_info(tsk->group_info); 151 put_group_info(tsk->__temp_cred.group_info);
152 delayacct_tsk_free(tsk); 152 delayacct_tsk_free(tsk);
153 153
154 if (!profile_handoff_task(tsk)) 154 if (!profile_handoff_task(tsk))
@@ -969,17 +969,18 @@ static struct task_struct *copy_process(unsigned long clone_flags,
969 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled); 969 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
970 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); 970 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
971#endif 971#endif
972 p->cred = &p->__temp_cred;
972 retval = -EAGAIN; 973 retval = -EAGAIN;
973 if (atomic_read(&p->user->processes) >= 974 if (atomic_read(&p->cred->user->processes) >=
974 p->signal->rlim[RLIMIT_NPROC].rlim_cur) { 975 p->signal->rlim[RLIMIT_NPROC].rlim_cur) {
975 if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) && 976 if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
976 p->user != current->nsproxy->user_ns->root_user) 977 p->cred->user != current->nsproxy->user_ns->root_user)
977 goto bad_fork_free; 978 goto bad_fork_free;
978 } 979 }
979 980
980 atomic_inc(&p->user->__count); 981 atomic_inc(&p->cred->user->__count);
981 atomic_inc(&p->user->processes); 982 atomic_inc(&p->cred->user->processes);
982 get_group_info(p->group_info); 983 get_group_info(p->cred->group_info);
983 984
984 /* 985 /*
985 * If multiple threads are within copy_process(), then this check 986 * If multiple threads are within copy_process(), then this check
@@ -1035,9 +1036,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1035 p->real_start_time = p->start_time; 1036 p->real_start_time = p->start_time;
1036 monotonic_to_bootbased(&p->real_start_time); 1037 monotonic_to_bootbased(&p->real_start_time);
1037#ifdef CONFIG_SECURITY 1038#ifdef CONFIG_SECURITY
1038 p->security = NULL; 1039 p->cred->security = NULL;
1039#endif 1040#endif
1040 p->cap_bset = current->cap_bset;
1041 p->io_context = NULL; 1041 p->io_context = NULL;
1042 p->audit_context = NULL; 1042 p->audit_context = NULL;
1043 cgroup_fork(p); 1043 cgroup_fork(p);
@@ -1298,9 +1298,9 @@ bad_fork_cleanup_cgroup:
1298bad_fork_cleanup_put_domain: 1298bad_fork_cleanup_put_domain:
1299 module_put(task_thread_info(p)->exec_domain->module); 1299 module_put(task_thread_info(p)->exec_domain->module);
1300bad_fork_cleanup_count: 1300bad_fork_cleanup_count:
1301 put_group_info(p->group_info); 1301 put_group_info(p->cred->group_info);
1302 atomic_dec(&p->user->processes); 1302 atomic_dec(&p->cred->user->processes);
1303 free_uid(p->user); 1303 free_uid(p->cred->user);
1304bad_fork_free: 1304bad_fork_free:
1305 free_task(p); 1305 free_task(p);
1306fork_out: 1306fork_out: