From owner-freebsd-hackers Sun Sep 20 07:22:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA01402 for freebsd-hackers-outgoing; Sun, 20 Sep 1998 07:22:36 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA01390 for ; Sun, 20 Sep 1998 07:22:28 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.8.8/8.8.8/Spinner) with ESMTP id WAA04063; Sun, 20 Sep 1998 22:21:26 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199809201421.WAA04063@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Greg Lehey cc: Warner Losh , freebsd-hackers@FreeBSD.ORG Subject: Re: syscalls and the stack In-reply-to: Your message of "Fri, 11 Sep 1998 10:40:50 +0930." <19980911104050.B13960@freebie.lemis.com> Date: Sun, 20 Sep 1998 22:21:25 +0800 From: Peter Wemm Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greg Lehey wrote: > On Wednesday, 9 September 1998 at 20:35:29 -0600, Warner Losh wrote: > > > > Question: > > do system calls need to be made from the executable stack? > > No. That's why copyin() and copyout() exist. > > > If this were disallowed, what would break? > > Who knows? I think the official answer is "nothing", but I'm sure > that some code uses pointers instead of copying the data. Yes, there is a small chunk of code copied to the very top of the user stack at process startup time. This code makes syscalls as part of the signal trampoline (sigreturn() in particular). If this trampoline was present in (say) libc, there is a slight problem of the kernel "finding" it in the current process address space, and even more of a problem if it's an "old" libc binary. This could probably all be patched up if we were willing to break binary compatability in a fairly major way (ie: would not be able to run old binaries). Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message