diff options
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/elfload.c | 5 | ||||
-rw-r--r-- | linux-user/syscall.c | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index d80d68484b..9a2ec568b0 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2798,8 +2798,9 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr, if (addr == MAP_FAILED || addr != test) { error_report("Unable to reserve 0x%lx bytes of virtual address " "space at %p (%s) for use as guest address space (check your " - "virtual memory ulimit setting, min_mmap_addr or reserve less " - "using -R option)", reserved_va + 1, test, strerror(errno)); + "virtual memory ulimit setting, mmap_min_addr or reserve less " + "using qemu-user's -R option)", + reserved_va + 1, test, strerror(errno)); exit(EXIT_FAILURE); } diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 83685f0aa5..f2cb101d83 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11670,13 +11670,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, case TARGET_NR_setregid: return get_errno(setregid(low2highgid(arg1), low2highgid(arg2))); case TARGET_NR_getgroups: - { + { /* the same code as for TARGET_NR_getgroups32 */ int gidsetsize = arg1; target_id *target_grouplist; g_autofree gid_t *grouplist = NULL; int i; - if (gidsetsize > NGROUPS_MAX) { + if (gidsetsize > NGROUPS_MAX || gidsetsize < 0) { return -TARGET_EINVAL; } if (gidsetsize > 0) { @@ -11701,7 +11701,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, return ret; } case TARGET_NR_setgroups: - { + { /* the same code as for TARGET_NR_setgroups32 */ int gidsetsize = arg1; target_id *target_grouplist; g_autofree gid_t *grouplist = NULL; @@ -12006,13 +12006,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_getgroups32 case TARGET_NR_getgroups32: - { + { /* the same code as for TARGET_NR_getgroups */ int gidsetsize = arg1; uint32_t *target_grouplist; g_autofree gid_t *grouplist = NULL; int i; - if (gidsetsize > NGROUPS_MAX) { + if (gidsetsize > NGROUPS_MAX || gidsetsize < 0) { return -TARGET_EINVAL; } if (gidsetsize > 0) { @@ -12038,7 +12038,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_setgroups32 case TARGET_NR_setgroups32: - { + { /* the same code as for TARGET_NR_setgroups */ int gidsetsize = arg1; uint32_t *target_grouplist; g_autofree gid_t *grouplist = NULL; |