From: riku.voipio@linaro.org
To: qemu-devel@nongnu.org
Cc: Andreas Schwab <schwab@suse.de>
Subject: [Qemu-devel] [PATCH 3/3] linux-user: fix setgroups/getgroups for non-UID16 archs
Date: Fri, 19 Apr 2013 16:59:56 +0300 [thread overview]
Message-ID: <03903ffcfb5a7c75e52da97d00eb9d0bb0660f28.1366377671.git.riku.voipio@linaro.org> (raw)
In-Reply-To: <cover.1366377671.git.riku.voipio@linaro.org>
From: Andreas Schwab <schwab@suse.de>
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>
---
linux-user/syscall.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5a786f2..c705960 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;
--
1.7.10.4
next prev parent reply other threads:[~2013-04-19 14:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-19 13:59 [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches riku.voipio
2013-04-19 13:59 ` [Qemu-devel] [PATCH 1/3] linux-user: change do_semop to return target errno when unsuccessful riku.voipio
2013-04-19 13:59 ` [Qemu-devel] [PATCH 2/3] linux-user: fix undefined shift in copy_to_user_fdset riku.voipio
2013-04-19 13:59 ` riku.voipio [this message]
2013-04-20 12:38 ` [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03903ffcfb5a7c75e52da97d00eb9d0bb0660f28.1366377671.git.riku.voipio@linaro.org \
--to=riku.voipio@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).