All of lore.kernel.org
 help / color / mirror / Atom feed
From: riku.voipio@linaro.org
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Felix Janda <felix.janda@posteo.de>
Subject: [Qemu-devel] [PULL 07/11] linux-user: translate resource also for prlimit64
Date: Tue, 27 Jan 2015 23:07:18 +0200	[thread overview]
Message-ID: <95018018caeea209f58695645fd1d50a9d0ba6df.1422392096.git.riku.voipio@linaro.org> (raw)
In-Reply-To: <cover.1422392096.git.riku.voipio@linaro.org>

From: Felix Janda <felix.janda@posteo.de>

The resource argument is translated from host to target for
[gs]etprlimit but not for prlimit64. Fix this.

Signed-off-by: Felix Janda <felix.janda@posteo.de>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 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.1.4

  parent reply	other threads:[~2015-01-27 21:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-27 21:07 [Qemu-devel] [PULL 00/11] linux-user-updates riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 01/11] linux-user/signal.c: Remove current_exec_domain_sig() riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 02/11] linux-user/alpha: Add define for NR_shmat to enable shmat syscall riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 03/11] linux-user/arm/nwfpe: Delete unused aCC array riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 04/11] linux-user/main.c: Call cpu_exec_start/end on all target archs riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 05/11] linux-user/main.c: Mark end_exclusive() as possibly unused riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 06/11] linux-user/signal.c: Remove unnecessary wrapper copy_siginfo_to_user riku.voipio
2015-01-27 21:07 ` riku.voipio [this message]
2015-01-27 21:07 ` [Qemu-devel] [PULL 08/11] linux-user: Fix ioctl cmd type mismatch on 64-bit targets riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 09/11] mips64-linux-user: Fix definition of struct sigaltstack riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 10/11] linux-user: Fix broken m68k signal handling on 64 bit hosts riku.voipio
2015-01-27 21:07 ` [Qemu-devel] [PULL 11/11] linux-user: support target-to-host SCM_CREDENTIALS riku.voipio
2015-01-27 23:17 ` [Qemu-devel] [PULL 00/11] linux-user-updates Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95018018caeea209f58695645fd1d50a9d0ba6df.1422392096.git.riku.voipio@linaro.org \
    --to=riku.voipio@linaro.org \
    --cc=felix.janda@posteo.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.