Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HXisq-0002Aw-KR for qemu-devel@nongnu.org; Sat, 31 Mar 2007 15:05:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HXiso-0002AZ-JQ for qemu-devel@nongnu.org; Sat, 31 Mar 2007 15:05:03 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HXiso-0002AW-Dn for qemu-devel@nongnu.org; Sat, 31 Mar 2007 14:05:02 -0500 Received: from phoenix.bawue.net ([193.7.176.60] helo=mail.bawue.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HXipx-00054a-Uk for qemu-devel@nongnu.org; Sat, 31 Mar 2007 15:02:06 -0400 Date: Sat, 31 Mar 2007 19:58:08 +0100 Subject: Re: [Qemu-devel] [PATCH] semaphore syscalls - refresh Message-ID: <20070331185808.GB24690@networkno.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: From: Thiemo Seufer Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stuart Anderson Cc: qemu-devel@nongnu.org Stuart Anderson wrote: > > This is a refresh of a prior patch to fix the semaphore system calls > sem*() in user-linux mode. Some additional cases have been dealt with, > and a small amount of code re-arrainging to prepare for the EFAULT patch. > Tested using Linux Test Project in the target. [snip] > +static inline void target_to_host_semun(unsigned long cmd, > + union semun *host_su, > + target_ulong target_addr, > + struct semid_ds *ds) > +{ > + union target_semun *target_su; > + > + switch( cmd ) { > + case GETALL: > + case SETALL: > + case IPC_STAT: > + case IPC_SET: > + lock_user_struct(target_su, target_addr, 1); > + target_to_host_semid_ds(ds,target_su->buf); > + host_su->buf = ds; > + unlock_user_struct(target_su, target_addr, 0); > + break; I don't see how this can work with target_su being an uninitialized pointer. Thiemo