summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/fork.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index a60459947f18..7f49be94eba9 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1833,8 +1833,6 @@ static __latent_entropy struct task_struct *copy_process(
1833 1833
1834 posix_cpu_timers_init(p); 1834 posix_cpu_timers_init(p);
1835 1835
1836 p->start_time = ktime_get_ns();
1837 p->real_start_time = ktime_get_boot_ns();
1838 p->io_context = NULL; 1836 p->io_context = NULL;
1839 audit_set_context(p, NULL); 1837 audit_set_context(p, NULL);
1840 cgroup_fork(p); 1838 cgroup_fork(p);
@@ -2001,6 +1999,17 @@ static __latent_entropy struct task_struct *copy_process(
2001 goto bad_fork_free_pid; 1999 goto bad_fork_free_pid;
2002 2000
2003 /* 2001 /*
2002 * From this point on we must avoid any synchronous user-space
2003 * communication until we take the tasklist-lock. In particular, we do
2004 * not want user-space to be able to predict the process start-time by
2005 * stalling fork(2) after we recorded the start_time but before it is
2006 * visible to the system.
2007 */
2008
2009 p->start_time = ktime_get_ns();
2010 p->real_start_time = ktime_get_boot_ns();
2011
2012 /*
2004 * Make it visible to the rest of the system, but dont wake it up yet. 2013 * Make it visible to the rest of the system, but dont wake it up yet.
2005 * Need tasklist lock for parent etc handling! 2014 * Need tasklist lock for parent etc handling!
2006 */ 2015 */