Skip to content

Commit

Permalink
linux-user: translate resource also for prlimit64
Browse files Browse the repository at this point in the history
The resource argument is translated from host to target for
[gs]etprlimit but not for prlimit64. Fix this.

Signed-off-by: Felix Janda <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
  • Loading branch information
doughdemon authored and Riku Voipio committed Jan 27, 2015
1 parent f6c7a05 commit 9501801
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion linux-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -9529,6 +9529,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
/* args: pid, resource number, ptr to new rlimit, ptr to old rlimit */
struct target_rlimit64 *target_rnew, *target_rold;
struct host_rlimit64 rnew, rold, *rnewp = 0;
int resource = target_to_host_resource(arg2);
if (arg3) {
if (!lock_user_struct(VERIFY_READ, target_rnew, arg3, 1)) {
goto efault;
Expand All @@ -9539,7 +9540,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
rnewp = &rnew;
}

ret = get_errno(sys_prlimit64(arg1, arg2, rnewp, arg4 ? &rold : 0));
ret = get_errno(sys_prlimit64(arg1, resource, rnewp, arg4 ? &rold : 0));
if (!is_error(ret) && arg4) {
if (!lock_user_struct(VERIFY_WRITE, target_rold, arg4, 1)) {
goto efault;
Expand Down

0 comments on commit 9501801

Please sign in to comment.