From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvujn-0002JF-UD for qemu-devel@nongnu.org; Tue, 02 Dec 2014 16:12:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xvujh-0005a2-Sc for qemu-devel@nongnu.org; Tue, 02 Dec 2014 16:11:59 -0500 Received: from mx02.posteo.de ([89.146.194.165]:45217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvujh-0005ZM-MC for qemu-devel@nongnu.org; Tue, 02 Dec 2014 16:11:53 -0500 Received: from dovecot04.posteo.de (unknown [185.67.36.27]) by mx02.posteo.de (Postfix) with ESMTPS id 66C3D25B17CF for ; Tue, 2 Dec 2014 22:11:52 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot04.posteo.de (Postfix) with ESMTPSA id 3jsbbX0kl8zFpY3 for ; Tue, 2 Dec 2014 22:11:52 +0100 (CET) Date: Tue, 2 Dec 2014 22:11:17 +0100 From: Felix Janda Message-ID: <20141202211117.GA5560@euler> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] linux-user: translate resource also for prlimit64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The resource argument is translated from host to target for [gs]etprlimit but not for prlimit64. Fix this. Signed-off-by: Felix Janda --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index aaac6a2..5658b66 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -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; @@ -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; -- 2.0.4