aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2013-04-09 05:41:33 +0000
committerRiku Voipio <riku.voipio@linaro.org>2013-04-19 10:48:51 +0300
commit03903ffcfb5a7c75e52da97d00eb9d0bb0660f28 (patch)
tree5710562814029c27766b23ff71eefd74d4025284 /linux-user
parent9ab709be595bef9956ea550a95e14e157cb5704e (diff)
linux-user: fix setgroups/getgroups for non-UID16 archs
Don't assume target_id is a short. Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5a786f2fef..c705960d7e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7743,12 +7743,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
if (gidsetsize == 0)
break;
if (!is_error(ret)) {
- target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 2, 0);
+ target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * sizeof(target_id), 0);
if (!target_grouplist)
goto efault;
for(i = 0;i < ret; i++)
target_grouplist[i] = tswapid(high2lowgid(grouplist[i]));
- unlock_user(target_grouplist, arg2, gidsetsize * 2);
+ unlock_user(target_grouplist, arg2, gidsetsize * sizeof(target_id));
}
}
break;
@@ -7760,7 +7760,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
int i;
if (gidsetsize) {
grouplist = alloca(gidsetsize * sizeof(gid_t));
- target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * 2, 1);
+ target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * sizeof(target_id), 1);
if (!target_grouplist) {
ret = -TARGET_EFAULT;
goto fail;