* [Qemu-devel] [PATCH 1/3] linux-user: change do_semop to return target errno when unsuccessful
2013-04-19 13:59 [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches riku.voipio
@ 2013-04-19 13:59 ` riku.voipio
2013-04-19 13:59 ` [Qemu-devel] [PATCH 2/3] linux-user: fix undefined shift in copy_to_user_fdset riku.voipio
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2013-04-19 13:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Petar Jovanovic
From: Petar Jovanovic <petar.jovanovic@imgtec.com>
do_semop() is called from two places, and one of these fails to convert
return error to target errno when semop fails. This patch changes the
function to always return target errno in case of an unsuccessful call.
Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
linux-user/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1f07621..d6d2050 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2764,7 +2764,7 @@ static inline abi_long do_semop(int semid, abi_long ptr, unsigned nsops)
if (target_to_host_sembuf(sops, ptr, nsops))
return -TARGET_EFAULT;
- return semop(semid, sops, nsops);
+ return get_errno(semop(semid, sops, nsops));
}
struct target_msqid_ds
@@ -6957,7 +6957,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#endif
#ifdef TARGET_NR_semop
case TARGET_NR_semop:
- ret = get_errno(do_semop(arg1, arg2, arg3));
+ ret = do_semop(arg1, arg2, arg3);
break;
#endif
#ifdef TARGET_NR_semctl
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 2/3] linux-user: fix undefined shift in copy_to_user_fdset
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 ` riku.voipio
2013-04-19 13:59 ` [Qemu-devel] [PATCH 3/3] linux-user: fix setgroups/getgroups for non-UID16 archs riku.voipio
2013-04-20 12:38 ` [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches Blue Swirl
3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2013-04-19 13:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Schwab
From: Andreas Schwab <schwab@suse.de>
If TARGET_ABI_BITS is bigger than 32 we shift by more than the size of int.
Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
linux-user/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d6d2050..5a786f2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -914,7 +914,7 @@ static inline abi_long copy_to_user_fdset(abi_ulong target_fds_addr,
for (i = 0; i < nw; i++) {
v = 0;
for (j = 0; j < TARGET_ABI_BITS; j++) {
- v |= ((FD_ISSET(k, fds) != 0) << j);
+ v |= ((abi_ulong)(FD_ISSET(k, fds) != 0) << j);
k++;
}
__put_user(v, &target_fds[i]);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 3/3] linux-user: fix setgroups/getgroups for non-UID16 archs
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
2013-04-20 12:38 ` [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches Blue Swirl
3 siblings, 0 replies; 5+ messages in thread
From: riku.voipio @ 2013-04-19 13:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Andreas Schwab
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches
2013-04-19 13:59 [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches riku.voipio
` (2 preceding siblings ...)
2013-04-19 13:59 ` [Qemu-devel] [PATCH 3/3] linux-user: fix setgroups/getgroups for non-UID16 archs riku.voipio
@ 2013-04-20 12:38 ` Blue Swirl
3 siblings, 0 replies; 5+ messages in thread
From: Blue Swirl @ 2013-04-20 12:38 UTC (permalink / raw)
To: Riku Voipio; +Cc: qemu-devel
Thanks, pulled.
On Fri, Apr 19, 2013 at 1:59 PM, <riku.voipio@linaro.org> wrote:
> From: Riku Voipio <riku.voipio@linaro.org>
>
> The following changes since commit 09dada400328d75daf79e3eca1e48e024fec148d:
>
> configure: remove duplicate test (2013-04-18 14:12:31 +0200)
>
> are available in the git repository at:
>
> git://git.linaro.org/people/rikuvoipio/qemu.git linux-user-for-upstream
>
> for you to fetch changes up to 03903ffcfb5a7c75e52da97d00eb9d0bb0660f28:
>
> linux-user: fix setgroups/getgroups for non-UID16 archs (2013-04-19 10:48:51 +0300)
>
> ----------------------------------------------------------------
> Andreas Schwab (2):
> linux-user: fix undefined shift in copy_to_user_fdset
> linux-user: fix setgroups/getgroups for non-UID16 archs
>
> Petar Jovanovic (1):
> linux-user: change do_semop to return target errno when unsuccessful
>
> linux-user/syscall.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
>
> --
> 1.7.10.4
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread