From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IpqRy-0002he-Pz for qemu-devel@nongnu.org; Wed, 07 Nov 2007 14:20:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IpqRy-0002hR-EJ for qemu-devel@nongnu.org; Wed, 07 Nov 2007 14:20:30 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IpqRy-0002hO-8U for qemu-devel@nongnu.org; Wed, 07 Nov 2007 14:20:30 -0500 Received: from sp604005mt.neufgp.fr ([84.96.92.11] helo=smtp.Neuf.fr) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IpqRy-0005qf-EN for qemu-devel@nongnu.org; Wed, 07 Nov 2007 14:20:30 -0500 Received: from [84.102.211.92] by sp604005mt.gpm.neuf.ld (Sun Java System Messaging Server 6.2-5.05 (built Feb 16 2006)) with ESMTP id <0JR5000P2HMTYS44@sp604005mt.gpm.neuf.ld> for qemu-devel@nongnu.org; Wed, 07 Nov 2007 20:18:35 +0100 (CET) Date: Wed, 07 Nov 2007 20:18:06 +0100 From: Fabrice Bellard Subject: Re: [Qemu-devel] RFC: x86_64 Best way to fix 'cast to pointer from integer of different size' problems? In-reply-to: <1194314417.5154.176.camel@phantasm.home.enterpriseandprosperity.com> Message-id: <47320F6E.5060505@bellard.org> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <1194110810.13889.25.camel@hephaestion> <200711031752.20135.paul@codesourcery.com> <1194292268.5154.73.camel@phantasm.home.enterpriseandprosperity.com> <200711060105.04529.paul@codesourcery.com> <1194314417.5154.176.camel@phantasm.home.enterpriseandprosperity.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: thayne@c2.net, qemu-devel@nongnu.org, paul@codesourcery.com Hi, Regarding the user memory access, here is my suggestion which should minimize the changes: - Keep __put_user() and __get_user() as you did. - Remove put_user(), get_user(), copy_from_user() and copy_to_user() - Modify the signal.c code so that it uses __put_user, __get_user and lock/unlock_user. - Modify lock_user() so that it automatically does access_ok() and returns NULL if access_ok() fails. - Test lock_user/lock_user_struct/... return value explicitely at every call. - Fix page_check_range() so that it handles writes to pages containing code by calling page_unprotect when necessary (the current code can fail in this case !). - Suppress no longer needed page_unprotect_range() call in syscall.c. - Suppress or fix tput/tget macros so that they do access_ok(). Regards, Fabrice.