aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 3fc3c1383912..490495a39c7e 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -107,6 +107,7 @@ static struct kmem_cache *mm_cachep;
107 107
108void free_task(struct task_struct *tsk) 108void free_task(struct task_struct *tsk)
109{ 109{
110 prop_local_destroy_single(&tsk->dirties);
110 free_thread_info(tsk->stack); 111 free_thread_info(tsk->stack);
111 rt_mutex_debug_task_free(tsk); 112 rt_mutex_debug_task_free(tsk);
112 free_task_struct(tsk); 113 free_task_struct(tsk);
@@ -163,6 +164,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
163{ 164{
164 struct task_struct *tsk; 165 struct task_struct *tsk;
165 struct thread_info *ti; 166 struct thread_info *ti;
167 int err;
166 168
167 prepare_to_copy(orig); 169 prepare_to_copy(orig);
168 170
@@ -178,6 +180,14 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
178 180
179 *tsk = *orig; 181 *tsk = *orig;
180 tsk->stack = ti; 182 tsk->stack = ti;
183
184 err = prop_local_init_single(&tsk->dirties);
185 if (err) {
186 free_thread_info(ti);
187 free_task_struct(tsk);
188 return NULL;
189 }
190
181 setup_thread_stack(tsk, orig); 191 setup_thread_stack(tsk, orig);
182 192
183#ifdef CONFIG_CC_STACKPROTECTOR 193#ifdef CONFIG_CC_STACKPROTECTOR
@@ -1069,7 +1079,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1069 do_posix_clock_monotonic_gettime(&p->start_time); 1079 do_posix_clock_monotonic_gettime(&p->start_time);
1070 p->real_start_time = p->start_time; 1080 p->real_start_time = p->start_time;
1071 monotonic_to_bootbased(&p->real_start_time); 1081 monotonic_to_bootbased(&p->real_start_time);
1082#ifdef CONFIG_SECURITY
1072 p->security = NULL; 1083 p->security = NULL;
1084#endif
1073 p->io_context = NULL; 1085 p->io_context = NULL;
1074 p->io_wait = NULL; 1086 p->io_wait = NULL;
1075 p->audit_context = NULL; 1087 p->audit_context = NULL;
@@ -1146,13 +1158,14 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1146 * Clear TID on mm_release()? 1158 * Clear TID on mm_release()?
1147 */ 1159 */
1148 p->clear_child_tid = (clone_flags & CLONE_CHILD_CLEARTID) ? child_tidptr: NULL; 1160 p->clear_child_tid = (clone_flags & CLONE_CHILD_CLEARTID) ? child_tidptr: NULL;
1161#ifdef CONFIG_FUTEX
1149 p->robust_list = NULL; 1162 p->robust_list = NULL;
1150#ifdef CONFIG_COMPAT 1163#ifdef CONFIG_COMPAT
1151 p->compat_robust_list = NULL; 1164 p->compat_robust_list = NULL;
1152#endif 1165#endif
1153 INIT_LIST_HEAD(&p->pi_state_list); 1166 INIT_LIST_HEAD(&p->pi_state_list);
1154 p->pi_state_cache = NULL; 1167 p->pi_state_cache = NULL;
1155 1168#endif
1156 /* 1169 /*
1157 * sigaltstack should be cleared when sharing the same VM 1170 * sigaltstack should be cleared when sharing the same VM
1158 */ 1171 */
@@ -1435,8 +1448,7 @@ long do_fork(unsigned long clone_flags,
1435#define ARCH_MIN_MMSTRUCT_ALIGN 0 1448#define ARCH_MIN_MMSTRUCT_ALIGN 0
1436#endif 1449#endif
1437 1450
1438static void sighand_ctor(void *data, struct kmem_cache *cachep, 1451static void sighand_ctor(struct kmem_cache *cachep, void *data)
1439 unsigned long flags)
1440{ 1452{
1441 struct sighand_struct *sighand = data; 1453 struct sighand_struct *sighand = data;
1442 1454