summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_sched.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2011-08-03 16:11:31 +0000
committerguenther <guenther@openbsd.org>2011-08-03 16:11:31 +0000
commit0d10e48092b36cce4d3418447492ff3df8d85a3a (patch)
tree18bc7143a1598dd4f82ed595000ebc8c908d322c /sys/compat/linux/linux_sched.c
parentRemove the 'obsolete file(s)' feature. It may come back at some point (diff)
downloadwireguard-openbsd-0d10e48092b36cce4d3418447492ff3df8d85a3a.tar.xz
wireguard-openbsd-0d10e48092b36cce4d3418447492ff3df8d85a3a.zip
Fix linux compat breakage: can't copyin() from kernel-space, so
move that out of i386_set_threadbase(), and have clone() pass NULL to fork1() for the child func argument so that it gets the child proc pointer. Report and verification by pirofti@, heavy lifting by matthew@
Diffstat (limited to 'sys/compat/linux/linux_sched.c')
-rw-r--r--sys/compat/linux/linux_sched.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_sched.c b/sys/compat/linux/linux_sched.c
index 61a4b5b98ad..14b00c23bf8 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.10 2011/04/05 15:44:40 pirofti Exp $ */
+/* $OpenBSD: linux_sched.c,v 1.11 2011/08/03 16:11:31 guenther Exp $ */
/* $NetBSD: linux_sched.c,v 1.6 2000/05/28 05:49:05 thorpej Exp $ */
/*-
@@ -177,7 +177,7 @@ linux_sys_clone(struct proc *p, void *v, register_t *retval)
* that makes this adjustment is a noop.
*/
error = fork1(p, sig, flags, SCARG(uap, stack), 0, linux_child_return,
- p, retval, NULL);
+ NULL, retval, NULL);
if (error)
return error;
@@ -407,8 +407,7 @@ linux_child_return(void *arg)
struct proc *p = (struct proc *)arg;
struct linux_emuldata *emul = p->p_emuldata;
- if (i386_set_threadbase(p, &emul->my_tls_base, TSEG_GS))
- return;
+ i386_set_threadbase(p, emul->my_tls_base, TSEG_GS);
if (emul->my_set_tid) {
pid_t pid = p->p_pid + THREAD_PID_OFFSET;