diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-10-16 05:29:52 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-10-16 05:29:52 +0000 |
commit | e9b2dbe5695582d77448b8fa0769c97400629b97 (patch) | |
tree | 0d6fdeea89fa58e56dd68b7aa22bb710f073f86c /sys/kern | |
parent | d8c22f78ca9c1ef8dfbe21a59d35e733ccee87f4 (diff) |
TCB address should be reset when execing, to provide a clean setup for
the new image
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_exec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 92db43a6f3b..1c5380c40f9 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.119 2011/06/06 17:10:23 ariane Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.120 2011/10/16 05:29:51 guenther Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -64,6 +64,10 @@ #include <machine/cpu.h> #include <machine/reg.h> +#ifdef __HAVE_MD_TCB +# include <machine/tcb.h> +#endif + #include <dev/rndvar.h> #include "systrace.h" @@ -454,6 +458,7 @@ sys_execve(struct proc *p, void *v, register_t *retval) stopprofclock(p); /* stop profiling */ fdcloseexec(p); /* handle close on exec */ execsigs(p); /* reset caught signals */ + TCB_SET(p, NULL); /* reset the TCB address */ /* set command name & other accounting info */ len = min(nid.ni_cnd.cn_namelen, MAXCOMLEN); |