From owner-freebsd-hackers Tue Jul 29 19:30:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA00642 for hackers-outgoing; Tue, 29 Jul 1997 19:30:09 -0700 (PDT) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA00636 for ; Tue, 29 Jul 1997 19:30:03 -0700 (PDT) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id TAA11782; Tue, 29 Jul 1997 19:30:39 -0700 (PDT) Message-Id: <199707300230.TAA11782@implode.root.com> To: Michael Smith cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Location of copyin() and copyout().. In-reply-to: Your message of "Wed, 30 Jul 1997 11:47:21 +0930." <199707300217.LAA16641@genesis.atrad.adelaide.edu.au> From: David Greenman Reply-To: dg@root.com Date: Tue, 29 Jul 1997 19:30:39 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >David Greenman stands accused of saying: >> >> There is no problem with using copyout() in the kernel to copy data out to >> a user process, assuming that the currently running process is the intended >> target of the copy. That is the sole purpose of the function. copyout() >> correctly handles all issues of COW/ZF/page faults. > >The only issue here is that the consumer of your service may _not_ be >a user process, eg. in the case of an ABI emulation module. I would >specifically request that people avoid using copyout unless they can >be _absolutely_ certain that they will only ever be talking to user >processes. > >As I said, this has already caused me heartache several times 8( I don't understand the distinction you're making. copyout *always* runs in the (kernel) context of a user process and the destination is always process (as opposed to kernel) memory. Please explain. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project