Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jun 2000 09:44:59 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Luoqi Chen <luoqi@watermarkgroup.com>
Cc:        dillon@apollo.backplane.com, arch@FreeBSD.ORG
Subject:   Re: Syscalls and execve
Message-ID:  <Pine.BSF.4.21.0006100944030.68954-100000@salmon.nlsystems.com>
In-Reply-To: <200006091239.e59Cd9T08096@lor.watermarkgroup.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 9 Jun 2000, Luoqi Chen wrote:

> > >     Why not have the new exec()'d process, when it gets the cpu in supervisor
> > >     mode, clear the registers in supervisor mode before returning
> > >     to user mode?  e.g. near the end of kern/kern_exec.c's execve().
> > >     (or somewhere similar).  Then at least the 'garbage' will be more 
> > >     like what you see on return from a syscall rather then something 
> > >     inherited from another process.
> > > 
> > Here the current process *is* the process calling exec() (unlike fork()), so 
> > why not just zero those registers in setregs()?
> > 
> > -lq
> > 
> I take back what I've just said, this won't guarantee zeros in those volatile
> registers. Moreover doesn't the new process image expect to see argc, argv,
> envp in the argument registers? Exec() needs special treatment, maybe an
> exec_trampoline()?

I think an exec_trampoline might well be the best solution. I can't quite
see how to work it though.

-- 
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 20 8442 9037




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0006100944030.68954-100000>