]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
linux-user: Fix sched_getaffinity mask size
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 11 Feb 2018 17:47:04 +0000 (18:47 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Sun, 18 Feb 2018 17:52:32 +0000 (18:52 +0100)
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 <samuel.thibault@ens-lyon.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180211174704.27441-1-samuel.thibault@ens-lyon.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c

index effc3a08816222120832e5b8aebd314ea70380d4..e24f43c4a2591c77b4aaa32a5483ea63c1706aa3 100644 (file)
@@ -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;