diff options
| author | 2019-01-15 15:37:46 +0100 | |
|---|---|---|
| committer | 2019-01-15 15:37:46 +0100 | |
| commit | cb7edfd4cd47ed50ea618b660ee283a2d99edff2 (patch) | |
| tree | fb2749afac5055798dcf8f0dca77c88e749307da /kernel/fork.c | |
| parent | USB: core: urb: Use struct_size() in kmalloc() (diff) | |
| parent | Linux 5.0-rc2 (diff) | |
| download | wireguard-linux-cb7edfd4cd47ed50ea618b660ee283a2d99edff2.tar.xz wireguard-linux-cb7edfd4cd47ed50ea618b660ee283a2d99edff2.zip | |
Merge 5.0-rc2 into usb-next
We need the USB fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index a60459947f18..b69248e6f0e0 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -217,6 +217,7 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node) memset(s->addr, 0, THREAD_SIZE); tsk->stack_vm_area = s; + tsk->stack = s->addr; return s->addr; } @@ -1833,8 +1834,6 @@ static __latent_entropy struct task_struct *copy_process( posix_cpu_timers_init(p); - p->start_time = ktime_get_ns(); - p->real_start_time = ktime_get_boot_ns(); p->io_context = NULL; audit_set_context(p, NULL); cgroup_fork(p); @@ -2001,6 +2000,17 @@ static __latent_entropy struct task_struct *copy_process( goto bad_fork_free_pid; /* + * From this point on we must avoid any synchronous user-space + * communication until we take the tasklist-lock. In particular, we do + * not want user-space to be able to predict the process start-time by + * stalling fork(2) after we recorded the start_time but before it is + * visible to the system. + */ + + p->start_time = ktime_get_ns(); + p->real_start_time = ktime_get_boot_ns(); + + /* * Make it visible to the rest of the system, but dont wake it up yet. * Need tasklist lock for parent etc handling! */ |
