aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-06-28 12:21:57 +0100
committerRiku Voipio <riku.voipio@linaro.org>2011-07-11 16:35:41 +0300
commit8f04eeb3c094bf370f131e50b7e3da85d08d518f (patch)
tree61b551092d2cfc30c7528bd03d09f2e0c8d3bd04
parent163a05a8398bc4b56c7498fa9901422a159168bf (diff)
linux-user/syscall.c: Enforce pselect6 sigset size restrictions
Enforce the same restriction on the size of the sigset passed to pselect6 as the Linux kernel does. This is both correct and silences a gcc 4.6 warning about a write-only variable. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rw-r--r--linux-user/syscall.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e2f356bb96..90f6789e5f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5699,6 +5699,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
if (arg_sigset) {
sig.set = &set;
+ if (arg_sigsize != sizeof(*target_sigset)) {
+ /* Like the kernel, we enforce correct size sigsets */
+ ret = -TARGET_EINVAL;
+ goto fail;
+ }
target_sigset = lock_user(VERIFY_READ, arg_sigset,
sizeof(*target_sigset), 1);
if (!target_sigset) {