summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_sched.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-05-24 01:19:16 +0000
committerguenther <guenther@openbsd.org>2012-05-24 01:19:16 +0000
commitb7f883556878a94e68e7ac6f877d584dfe11e4fe (patch)
treebb306473d1216a7dd14aae4487065d7f4c4575f9 /sys/compat/linux/linux_sched.c
parent- introduce temp_inet_net_pton_ipv6() temporarily until we have AF_INET6 (diff)
downloadwireguard-openbsd-b7f883556878a94e68e7ac6f877d584dfe11e4fe.tar.xz
wireguard-openbsd-b7f883556878a94e68e7ac6f877d584dfe11e4fe.zip
If LINUX_CLONE_SETTLS isn't set, then the clone()d child should inherit
the TCB value from the parent instead of having it zeroed. ok pirofti@
Diffstat (limited to 'sys/compat/linux/linux_sched.c')
-rw-r--r--sys/compat/linux/linux_sched.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_sched.c b/sys/compat/linux/linux_sched.c
index d0a3ea5c88a..cb35647a43b 100644
--- a/sys/compat/linux/linux_sched.c
+++ b/sys/compat/linux/linux_sched.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_sched.c,v 1.12 2012/04/12 15:42:52 guenther Exp $ */
+/* $OpenBSD: linux_sched.c,v 1.13 2012/05/24 01:19:16 guenther Exp $ */
/* $NetBSD: linux_sched.c,v 1.6 2000/05/28 05:49:05 thorpej Exp $ */
/*-
@@ -166,9 +166,10 @@ linux_sys_clone(struct proc *p, void *v, register_t *retval)
if (ldesc.entry_number != GUGS_SEL)
return (EINVAL);
emul->child_tls_base = ldesc.base_addr;
+ emul->set_tls_base = 1;
}
else
- emul->child_tls_base = 0;
+ emul->set_tls_base = 0;
/*
* Note that Linux does not provide a portable way of specifying
@@ -407,7 +408,8 @@ linux_child_return(void *arg)
struct proc *p = (struct proc *)arg;
struct linux_emuldata *emul = p->p_emuldata;
- i386_set_threadbase(p, emul->my_tls_base, TSEG_GS);
+ if (emul->set_tls_base)
+ i386_set_threadbase(p, emul->my_tls_base, TSEG_GS);
if (emul->my_set_tid) {
pid_t pid = p->p_pid + THREAD_PID_OFFSET;