From owner-freebsd-arch Fri Jun 9 5:39:12 2000 Delivered-To: freebsd-arch@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id 1520E37BD0F for ; Fri, 9 Jun 2000 05:39:11 -0700 (PDT) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.10.1/8.10.1) id e59Cd9T08096; Fri, 9 Jun 2000 08:39:10 -0400 (EDT) Date: Fri, 9 Jun 2000 08:39:10 -0400 (EDT) From: Luoqi Chen Message-Id: <200006091239.e59Cd9T08096@lor.watermarkgroup.com> To: dfr@nlsystems.com, dillon@apollo.backplane.com Subject: Re: Syscalls and execve Cc: arch@FreeBSD.ORG Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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()? -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message