linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Paul Burton <paul.burton@mips.com>
Cc: Elvira Khabirova <lineprinter@altlinux.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	James Hogan <jhogan@kernel.org>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mips: fix mips_get_syscall_arg o32 check
Date: Wed, 21 Nov 2018 22:14:39 +0300	[thread overview]
Message-ID: <20181121191438.GB10301@altlinux.org> (raw)
In-Reply-To: <20181121190009.GA10301@altlinux.org>

When checking for TIF_32BIT_REGS flag, mips_get_syscall_arg() should
use the task specified as its argument instead of the current task.

This potentially affects all syscall_get_arguments() users
who specify tasks different from the current.

Fixes: c0ff3c53d4f99 ("MIPS: Enable HAVE_ARCH_TRACEHOOK.")
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 arch/mips/include/asm/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 0170602a1e4e..6cf8ffb5367e 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -73,7 +73,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
 #ifdef CONFIG_64BIT
 	case 4: case 5: case 6: case 7:
 #ifdef CONFIG_MIPS32_O32
-		if (test_thread_flag(TIF_32BIT_REGS))
+		if (test_tsk_thread_flag(task, TIF_32BIT_REGS))
 			return get_user(*arg, (int *)usp + n);
 		else
 #endif
-- 
ldv

  reply	other threads:[~2018-11-21 19:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181107042751.3b519062@akathisia>
     [not found] ` <CALCETrV1v-DPRfDRwiH=xn29bxWxiHdZtAH1nw=dsmDtnT0YGQ@mail.gmail.com>
     [not found]   ` <20181120001128.GA11300@altlinux.org>
2018-11-21  0:44     ` [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument Dmitry V. Levin
2018-11-21 15:15       ` Andy Lutomirski
2018-11-21 15:47       ` Palmer Dabbelt
2018-11-21 18:40       ` Paul Burton
2018-11-21 18:40         ` Paul Burton
2018-11-21 19:00         ` Dmitry V. Levin
2018-11-21 19:14           ` Dmitry V. Levin [this message]
2018-11-21 19:23             ` [PATCH] mips: fix mips_get_syscall_arg o32 check Paul Burton
2018-11-21 19:23               ` Paul Burton
2018-11-21 19:35           ` [PATCH v2 16/15 v2] syscall_get_arch: add "struct task_struct *" argument Dmitry V. Levin
2018-11-21 19:45             ` Paul Burton
2018-11-21 19:45               ` Paul Burton
2018-11-27 10:34       ` [PATCH v2 16/15] " Michael Ellerman

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=20181121191438.GB10301@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=jhogan@kernel.org \
    --cc=lineprinter@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).