Skip to contentSkip to conversation

linux-user pending patches

GIT PULL New [email protected] 2 participants 5 messages Apr 19, 2013 – Apr 20, 2013

lore
Share & tools
lore
#0 lore raw

From: Riku Voipio <[email protected]>

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(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/3 linux-user: change do_semop to return target errno when unsuccessful

From: Petar Jovanovic <[email protected]>

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.

---
 linux-user/syscall.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/syscall.c +2 -2
index 1f07621..d6d2050 100644
@@ -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
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/3 linux-user: fix undefined shift in copy_to_user_fdset

In reply to [email protected]

From: Andreas Schwab <[email protected]>

If TARGET_ABI_BITS is bigger than 32 we shift by more than the size of int.

---
 linux-user/syscall.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/syscall.c +1 -1
index d6d2050..5a786f2 100644
@@ -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]);
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/3 linux-user: fix setgroups/getgroups for non-UID16 archs

In reply to [email protected]

From: Andreas Schwab <[email protected]>

Don't assume target_id is a short.

---
 linux-user/syscall.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
linux-user/syscall.c +3 -3
index 5a786f2..c705960 100644
@@ -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;
Signature · 1 line
1.7.10.4
#4 lore raw
In reply to [email protected]

Thanks, pulled.

Quoted 30 lines · On Fri, Apr 19, 2013 at 1:59 PM, <[email protected]> wrote:

From: Riku Voipio <[email protected]>

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