qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 3/4] linux-user: Fix sched_getaffinity mask size


From: Laurent Vivier
Subject: [Qemu-devel] [PULL 3/4] linux-user: Fix sched_getaffinity mask size
Date: Tue, 20 Feb 2018 10:16:39 +0100

From: Samuel Thibault <address@hidden>

We properly computed the capped mask size to be put to the application
buffer, but didn't actually used it. Also, we need to return the capped mask
size instead of 0 on success.

Signed-off-by: Samuel Thibault <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
 linux-user/syscall.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index effc3a0881..e24f43c4a2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -10502,7 +10502,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 
arg1,
                     ret = arg2;
                 }
 
-                ret = host_to_target_cpu_mask(mask, mask_size, arg3, arg2);
+                if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) {
+                    goto efault;
+                }
             }
         }
         break;
-- 
2.14.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]