diff options
| author | 2011-04-20 19:14:34 +0000 | |
|---|---|---|
| committer | 2011-04-20 19:14:34 +0000 | |
| commit | 7a492428eae52472a78fb4cf500bd387cba637d8 (patch) | |
| tree | aa78583496079004c4b769be2336c462bc73b2bb /sys/compat/linux/linux_exec.c | |
| parent | Remove some includes and defines that are no longer needed, from Michael (diff) | |
| download | wireguard-openbsd-7a492428eae52472a78fb4cf500bd387cba637d8.tar.xz wireguard-openbsd-7a492428eae52472a78fb4cf500bd387cba637d8.zip | |
Fix possible NULL dereference for emul data. Okay miod@.
Diffstat (limited to 'sys/compat/linux/linux_exec.c')
| -rw-r--r-- | sys/compat/linux/linux_exec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c index f9944ab5307..121dc1634ea 100644 --- a/sys/compat/linux/linux_exec.c +++ b/sys/compat/linux/linux_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_exec.c,v 1.33 2011/04/05 15:44:40 pirofti Exp $ */ +/* $OpenBSD: linux_exec.c,v 1.34 2011/04/20 19:14:34 pirofti Exp $ */ /* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */ /*- @@ -197,8 +197,8 @@ linux_e_proc_exit(struct proc *p) void linux_e_proc_fork(struct proc *p, struct proc *parent) { - struct linux_emuldata *emul = p->p_emuldata; - struct linux_emuldata *p_emul = parent->p_emuldata; + struct linux_emuldata *emul; + struct linux_emuldata *p_emul; /* Allocate new emuldata for the new process. */ p->p_emuldata = NULL; @@ -206,6 +206,9 @@ linux_e_proc_fork(struct proc *p, struct proc *parent) /* fork, use parent's vmspace (our vmspace may not be setup yet) */ linux_e_proc_init(p, parent->p_vmspace); + emul = p->p_emuldata; + p_emul = parent->p_emuldata; + emul->my_set_tid = p_emul->child_set_tid; emul->my_clear_tid = p_emul->child_clear_tid; emul->my_tls_base = p_emul->child_tls_base; |
