From owner-freebsd-hackers Mon Dec 6 15:30: 8 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.cdrom.com (mass.cdrom.com [204.216.28.184]) by hub.freebsd.org (Postfix) with ESMTP id 8C7D414F96 for ; Mon, 6 Dec 1999 15:30:05 -0800 (PST) (envelope-from msmith@mass.cdrom.com) Received: from mass.cdrom.com (localhost [127.0.0.1]) by mass.cdrom.com (8.9.3/8.9.3) with ESMTP id PAA02867; Mon, 6 Dec 1999 15:31:35 -0800 (PST) (envelope-from msmith@mass.cdrom.com) Message-Id: <199912062331.PAA02867@mass.cdrom.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: Luoqi Chen Cc: freebsd-hackers@FreeBSD.ORG, gallatin@cs.duke.edu Subject: Re: Is part of user stack always mapped? In-reply-to: Your message of "Mon, 06 Dec 1999 17:16:31 EST." <199912062216.RAA09858@lor.watermarkgroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 06 Dec 1999 15:31:35 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I was under the impression that this was a no-no & one should use > > copyin/copout & friends to access memory on users's stacks. Although > > this appears to work on the i386, if I try this on the alpha I take a > > fatal trap when accessing *set. > > > > So -- how does this work on the i386? Is the user's stack always > > mappeped into the kernel's address space? Should it also work on the > > alpha? > > > On i386, under the current implementation, the kernel can directly access > curproc's address space (not just the stack, stack is used because we're > sure the spare space won't/shouldn't be used by the user application). > I don't know if the same is true for alpha, but this should definitely > be considered an implementation dependent feature. I wish there were some > other ways to bypass copyin/out in ioctls. The problem wouldn't be a problem if the implementation portion of system call code didn't make assumptions about whether data is in user- or kernel-space. This has been an off and on topic of discussion for some time now. The ABI emulators use the stackgap because there are system call implementations that expect to be moving their data structures to/from user space. 8( -- \\ Give a man a fish, and you feed him for a day. \\ Mike Smith \\ Tell him he should learn how to fish himself, \\ msmith@freebsd.org \\ and he'll hate you for a lifetime. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message