qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes
@ 2011-05-02  9:19 riku.voipio
  2011-05-02  9:19 ` [Qemu-devel] [PATCH 1/3] linux-user: Fix compilation for "old" linux versions riku.voipio
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: riku.voipio @ 2011-05-02  9:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@iki.fi>

The following changes since commit 08ab2ccb08372a52ee1c597acf640cadb9089a3a:

  Merge branch 'patches' of git://qemu.weilnetz.de/git/qemu (2011-04-29 20:01:51 +0000)

are available in the git repository at:

  git://gitorious.org/qemu-maemo/qemu.git linux-user-for-upstream


Mike McCormack (2):
  Fix buffer overrun in sched_getaffinity
  Don't zero out buffer in sched_getaffinity

Stefan Weil (1):
  linux-user: Fix compilation for "old" linux versions

 linux-user/strace.c  |   12 ++++++++++++
 linux-user/syscall.c |   13 +------------
 2 files changed, 13 insertions(+), 12 deletions(-)

-- 
1.7.4.1

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

* [Qemu-devel] [PATCH 1/3] linux-user: Fix compilation for "old" linux versions
  2011-05-02  9:19 [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes riku.voipio
@ 2011-05-02  9:19 ` riku.voipio
  2011-05-02  9:19 ` [Qemu-devel] [PATCH 2/3] Fix buffer overrun in sched_getaffinity riku.voipio
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2011-05-02  9:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Stefan Weil <weil@mail.berlios.de>

Debian Lenny and other installations with older linux versions
failed to compile linux-user because some CLONE_xxx macros are
undefined.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 linux-user/strace.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 5d9bb08..fe9326a 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -477,12 +477,24 @@ UNUSED static struct flags clone_flags[] = {
     FLAG_GENERIC(CLONE_DETACHED),
     FLAG_GENERIC(CLONE_UNTRACED),
     FLAG_GENERIC(CLONE_CHILD_SETTID),
+#if defined(CLONE_NEWUTS)
     FLAG_GENERIC(CLONE_NEWUTS),
+#endif
+#if defined(CLONE_NEWIPC)
     FLAG_GENERIC(CLONE_NEWIPC),
+#endif
+#if defined(CLONE_NEWUSER)
     FLAG_GENERIC(CLONE_NEWUSER),
+#endif
+#if defined(CLONE_NEWPID)
     FLAG_GENERIC(CLONE_NEWPID),
+#endif
+#if defined(CLONE_NEWNET)
     FLAG_GENERIC(CLONE_NEWNET),
+#endif
+#if defined(CLONE_IO)
     FLAG_GENERIC(CLONE_IO),
+#endif
     FLAG_END,
 };
 
-- 
1.7.4.1

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

* [Qemu-devel] [PATCH 2/3] Fix buffer overrun in sched_getaffinity
  2011-05-02  9:19 [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes riku.voipio
  2011-05-02  9:19 ` [Qemu-devel] [PATCH 1/3] linux-user: Fix compilation for "old" linux versions riku.voipio
@ 2011-05-02  9:19 ` riku.voipio
  2011-05-02  9:19 ` [Qemu-devel] [PATCH 3/3] Don't zero out buffer " riku.voipio
  2011-05-02 10:15 ` [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes Edgar E. Iglesias
  3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2011-05-02  9:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mike McCormack, Riku Voipio

From: Mike McCormack <mj.mccormack@samsung.com>

Zeroing of the cpu array should start from &cpus[kernel_ret]
not &cpus[num_zeros_to_fill].

This fixes a crash in EFL's edje_cc running under qemu-arm.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 linux-user/syscall.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e969d1b..5b7b8e2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6505,7 +6505,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
                     unsigned long zero = arg2 - ret;
                     p = alloca(zero);
                     memset(p, 0, zero);
-                    if (copy_to_user(arg3 + zero, p, zero)) {
+                    if (copy_to_user(arg3 + ret, p, zero)) {
                         goto efault;
                     }
                     arg2 = ret;
-- 
1.7.4.1

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

* [Qemu-devel] [PATCH 3/3] Don't zero out buffer in sched_getaffinity
  2011-05-02  9:19 [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes riku.voipio
  2011-05-02  9:19 ` [Qemu-devel] [PATCH 1/3] linux-user: Fix compilation for "old" linux versions riku.voipio
  2011-05-02  9:19 ` [Qemu-devel] [PATCH 2/3] Fix buffer overrun in sched_getaffinity riku.voipio
@ 2011-05-02  9:19 ` riku.voipio
  2011-05-02 10:15 ` [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes Edgar E. Iglesias
  3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2011-05-02  9:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mike McCormack, Riku Voipio

From: Mike McCormack <mj.mccormack@samsung.com>

The kernel doesn't fill the buffer provided to sched_getaffinity
with zero bytes, so neither should QEMU.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 linux-user/syscall.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5b7b8e2..279cef3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6500,20 +6500,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(sys_sched_getaffinity(arg1, mask_size, mask));
 
             if (!is_error(ret)) {
-                if (arg2 > ret) {
-                    /* Zero out any extra space kernel didn't fill */
-                    unsigned long zero = arg2 - ret;
-                    p = alloca(zero);
-                    memset(p, 0, zero);
-                    if (copy_to_user(arg3 + ret, p, zero)) {
-                        goto efault;
-                    }
-                    arg2 = ret;
-                }
-                if (copy_to_user(arg3, mask, arg2)) {
+                if (copy_to_user(arg3, mask, ret)) {
                     goto efault;
                 }
-                ret = arg2;
             }
         }
         break;
-- 
1.7.4.1

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

* Re: [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes
  2011-05-02  9:19 [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes riku.voipio
                   ` (2 preceding siblings ...)
  2011-05-02  9:19 ` [Qemu-devel] [PATCH 3/3] Don't zero out buffer " riku.voipio
@ 2011-05-02 10:15 ` Edgar E. Iglesias
  3 siblings, 0 replies; 5+ messages in thread
From: Edgar E. Iglesias @ 2011-05-02 10:15 UTC (permalink / raw)
  To: riku.voipio; +Cc: qemu-devel

On Mon, May 02, 2011 at 12:19:07PM +0300, riku.voipio@iki.fi wrote:
> From: Riku Voipio <riku.voipio@iki.fi>
> 
> The following changes since commit 08ab2ccb08372a52ee1c597acf640cadb9089a3a:
> 
>   Merge branch 'patches' of git://qemu.weilnetz.de/git/qemu (2011-04-29 20:01:51 +0000)
> 
> are available in the git repository at:
> 
>   git://gitorious.org/qemu-maemo/qemu.git linux-user-for-upstream
> 
> 
> Mike McCormack (2):
>   Fix buffer overrun in sched_getaffinity
>   Don't zero out buffer in sched_getaffinity
> 
> Stefan Weil (1):
>   linux-user: Fix compilation for "old" linux versions


I've applied these, thanks!

Cheers

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

end of thread, other threads:[~2011-05-02 10:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-02  9:19 [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes riku.voipio
2011-05-02  9:19 ` [Qemu-devel] [PATCH 1/3] linux-user: Fix compilation for "old" linux versions riku.voipio
2011-05-02  9:19 ` [Qemu-devel] [PATCH 2/3] Fix buffer overrun in sched_getaffinity riku.voipio
2011-05-02  9:19 ` [Qemu-devel] [PATCH 3/3] Don't zero out buffer " riku.voipio
2011-05-02 10:15 ` [Qemu-devel] [PATCH 0/3] [PULL] linux-user fixes Edgar E. Iglesias

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).