From patchwork Tue Jan 27 21:07:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 43852 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 04D222409D for ; Tue, 27 Jan 2015 21:10:03 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf8989095lab.3 for ; Tue, 27 Jan 2015 13:10:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=ef3/Tsq57prSsaap9uguxTPpZJwXJVKXSLzrBtVnqBs=; b=PraXuVUtGNSB9keV/697pZSRAhvPVehr0m0PV40r1dO0wJuP85zEwlJSrgjrBu2AXh JHTUdS4psIBDOT2FfcD9W/c7quvIsfD244pCRab8OTKMGQ4pkHLH62NKdshH/pESP2vP 4F2kqWyCVZ1jecxUgKvQpIAb2rAZrl3LbGg88+/W19GSEJdoXgsXmRf9kSF2uixMQM0L md5VAYBjrM5s5CfhPoby48tR68nAb4T563xed+gMj+3nHNbYlKfZDb+OAzJ4Fb3yvPYw t6/dW096eVtZGex1n3fuwElC6a4oQflJuEs41UAtusamcfd7yWNYa9fHvScPqsk0P3bR E1Pg== X-Gm-Message-State: ALoCoQkywmvWIadMAK9OdeeLRvcK4Msps4065NGqlRVCuAL2YurMc7KBwokJo4STlFpSxa932pyO X-Received: by 10.180.7.226 with SMTP id m2mr11627wia.5.1422393001988; Tue, 27 Jan 2015 13:10:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.74 with SMTP id q10ls90361laq.43.gmail; Tue, 27 Jan 2015 13:10:01 -0800 (PST) X-Received: by 10.112.162.226 with SMTP id yd2mr4159063lbb.1.1422393001586; Tue, 27 Jan 2015 13:10:01 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id np9si2443831lbb.0.2015.01.27.13.10.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 13:10:01 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id 10so15292066lbg.10 for ; Tue, 27 Jan 2015 13:10:01 -0800 (PST) X-Received: by 10.112.135.196 with SMTP id pu4mr4149953lbb.41.1422393001435; Tue, 27 Jan 2015 13:10:01 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1227065lbj; Tue, 27 Jan 2015 13:10:00 -0800 (PST) X-Received: by 10.224.12.19 with SMTP id v19mr5936534qav.22.1422393000101; Tue, 27 Jan 2015 13:10:00 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d2si3060971qaf.109.2015.01.27.13.09.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 27 Jan 2015 13:10:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:49969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGDOZ-0006GK-5Y for patch@linaro.org; Tue, 27 Jan 2015 16:09:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGDMA-00047A-5r for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGDM5-0005mi-Hp for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:30 -0500 Received: from afflict.kos.to ([92.243.29.197]:35448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGDM5-0005mM-Cf for qemu-devel@nongnu.org; Tue, 27 Jan 2015 16:07:25 -0500 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 3FF55264DA; Tue, 27 Jan 2015 22:07:23 +0100 (CET) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 27 Jan 2015 23:07:18 +0200 Message-Id: <95018018caeea209f58695645fd1d50a9d0ba6df.1422392096.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: peter.maydell@linaro.org, Felix Janda Subject: [Qemu-devel] [PULL 07/11] linux-user: translate resource also for prlimit64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Felix Janda The resource argument is translated from host to target for [gs]etprlimit but not for prlimit64. Fix this. Signed-off-by: Felix Janda Signed-off-by: Riku Voipio --- 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;