qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from poll()
@ 2011-02-25 10:27 Peter Maydell
  2011-03-22  6:50 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2011-02-25 10:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, patches

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 <peter.maydell@linaro.org>
---
 linux-user/syscall.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from poll()
  2011-02-25 10:27 [Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from poll() Peter Maydell
@ 2011-03-22  6:50 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2011-03-22  6:50 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Riku Voipio, qemu-devel, patches

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 <peter.maydell@linaro.org>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-22  7:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25 10:27 [Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from poll() Peter Maydell
2011-03-22  6:50 ` Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).