File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -535,6 +535,9 @@ void put_task_stack(struct task_struct *tsk)
535
535
536
536
void free_task (struct task_struct * tsk )
537
537
{
538
+ #ifdef CONFIG_SECCOMP
539
+ WARN_ON_ONCE (tsk -> seccomp .filter );
540
+ #endif
538
541
release_user_cpus_ptr (tsk );
539
542
scs_release (tsk );
540
543
@@ -2406,12 +2409,6 @@ static __latent_entropy struct task_struct *copy_process(
2406
2409
2407
2410
spin_lock (& current -> sighand -> siglock );
2408
2411
2409
- /*
2410
- * Copy seccomp details explicitly here, in case they were changed
2411
- * before holding sighand lock.
2412
- */
2413
- copy_seccomp (p );
2414
-
2415
2412
rv_task_fork (p );
2416
2413
2417
2414
rseq_fork (p , clone_flags );
@@ -2428,6 +2425,14 @@ static __latent_entropy struct task_struct *copy_process(
2428
2425
goto bad_fork_cancel_cgroup ;
2429
2426
}
2430
2427
2428
+ /* No more failure paths after this point. */
2429
+
2430
+ /*
2431
+ * Copy seccomp details explicitly here, in case they were changed
2432
+ * before holding sighand lock.
2433
+ */
2434
+ copy_seccomp (p );
2435
+
2431
2436
init_task_pid_links (p );
2432
2437
if (likely (p -> pid )) {
2433
2438
ptrace_init_task (p , (clone_flags & CLONE_PTRACE ) || trace );
You can’t perform that action at this time.
0 commit comments