From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 9 06:19:00 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6865A943 for ; Tue, 9 Apr 2013 06:19:00 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) by mx1.freebsd.org (Postfix) with ESMTP id 568232BC for ; Tue, 9 Apr 2013 06:19:00 +0000 (UTC) Received: from delphij-macbook.local (unknown [IPv6:2001:470:83bf:0:10ba:ce65:5048:454a]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id DE4B666E8; Mon, 8 Apr 2013 23:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1365488340; bh=tHiuNGtOom7UgyFiuKUPJod2oCVeoKTwF9BsGnPeCIo=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=IBFekZizB6x0QpRn1IxhxC0YLK5m2YKvJ5fi9ok7VBMmEPBL8JFhGXCzfHYfMGTan eJGUmJBoAZKHupLGwMOsxI4qs+z2+Z2I8fPNTHAQ5sPOfaFwfex85F8n2Ag3RwuU9u yD/5bKop6V80aKtJHKhHj6YduiId7GLJYQhxhY7c= Message-ID: <5163B2CC.8080004@delphij.net> Date: Mon, 08 Apr 2013 23:18:52 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: copyinstr() References: In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2013 06:19:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 4/8/13 6:15 PM, Vijay Singh wrote: > Hi, I was looking for some help with copyinstr() on an amd64 > platform. > > My from address happens to be in the kernel (stack). I am getting > an EFAULT, and I am wondering how to fix that. Since you are doing a copy*in*str, I think "from" address would be the uaddr? In that case, it should be a userland address... > Would using memory from malloc() make a difference? Maybe not... EFAULT means the address is not valid. Cheers, -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJRY7LMAAoJEG80Jeu8UPuzXRcH+gOoKAIelHbF2tp78HHgp0+b zuRF+Cj8mBOxJEyS3zpKEVKdq8HgYEJRq39Tkp2c60xwYOUcU0HRU6ixTJ0whZFo Gbx7tBbp4+89TtkPVm/u/JlqeToQNuQSFJBxNGi1qOjPpJQfuClPQ9EI4N4LDesh g8B7D5N4YoIUhLkg2FEix7c3XrzTeDRCfXYsfHna4f3VMrlNze0R61TpRqh6qx8/ eJDBA25m6+Y6129qo8wdkOZWLT6ZSIPrc6WgQuCP3jTYJemhiM1RdTFLqM87PNBd EGuL1+FGgDUzhieJoOx/FhD01Cypc7/Qs6pxaF1BGxpCaL0SPFyBJ+WBnv9A7DA= =iMeL -----END PGP SIGNATURE-----