Received: from [140.186.70.92] (port=46015 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1vd7-0000Q2-JD for qemu-devel@nongnu.org; Tue, 22 Mar 2011 03:03:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1vce-00039F-N2 for qemu-devel@nongnu.org; Tue, 22 Mar 2011 03:03:21 -0400 Received: from hall.aurel32.net ([88.191.126.93]:61000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1vce-000398-EP for qemu-devel@nongnu.org; Tue, 22 Mar 2011 03:03:20 -0400 Date: Tue, 22 Mar 2011 07:50:42 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from poll() Message-ID: <20110322065042.GH19515@ohm.aurel32.net> References: <1298629660-23901-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1298629660-23901-1-git-send-email-peter.maydell@linaro.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Riku Voipio , qemu-devel@nongnu.org, patches@linaro.org On Fri, Feb 25, 2011 at 10:27:40AM +0000, Peter Maydell wrote: > Correct the broken attempt to calculate the third argument > to unlock_user() in the code path which unlocked the pollfd > array on return from poll() and ppoll() emulation. (This > only caused a problem if unlock_user() wasn't a no-op, eg > if DEBUG_REMAP is defined.) > > Signed-off-by: Peter Maydell > --- > linux-user/syscall.c | 4 +--- > 1 files changed, 1 insertions(+), 3 deletions(-) Thanks, applied. > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index cf8a4c3..822b863 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -6314,10 +6314,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, > for(i = 0; i < nfds; i++) { > target_pfd[i].revents = tswap16(pfd[i].revents); > } > - ret += nfds * (sizeof(struct target_pollfd) > - - sizeof(struct pollfd)); > } > - unlock_user(target_pfd, arg1, ret); > + unlock_user(target_pfd, arg1, sizeof(struct target_pollfd) * nfds); > } > break; > #endif > -- > 1.7.1 > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net