linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Elvira Khabirova <lineprinter0@gmail.com>
Cc: "Dmitry V. Levin" <ldv@strace.io>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hogan <jhogan@kernel.org>,
	Andreas Henriksson <ah@debian.org>
Subject: Re: [PATCH] mips: fix syscall_get_nr
Date: Sun, 19 Feb 2023 09:30:22 +0100	[thread overview]
Message-ID: <20230219083022.GA2924@alpha.franken.de> (raw)
In-Reply-To: <20230218233212.1fed456b@akathisia>

On Sat, Feb 18, 2023 at 11:43:59PM +0100, Elvira Khabirova wrote:
> The implementation of syscall_get_nr on mips used to ignore the task
> argument and return the syscall number of the calling thread instead of
> the target thread.
> 
> The bug was exposed to user space by commit 201766a20e30f ("ptrace: add
> PTRACE_GET_SYSCALL_INFO request") and detected by strace test suite.
> 
> Link: https://github.com/strace/strace/issues/235
> Fixes: c2d9f1775731 ("MIPS: Fix syscall_get_nr for the syscall exit tracing.")
> Cc: <stable@vger.kernel.org> # v3.19+
> Co-developed-by: Dmitry V. Levin <ldv@strace.io>
> Signed-off-by: Dmitry V. Levin <ldv@strace.io>
> Signed-off-by: Elvira Khabirova <lineprinter0@gmail.com>
> ---
>  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 25fa651c937d..ebdf4d910af2 100644
> --- a/arch/mips/include/asm/syscall.h
> +++ b/arch/mips/include/asm/syscall.h
> @@ -38,7 +38,7 @@ static inline bool mips_syscall_is_indirect(struct task_struct *task,
>  static inline long syscall_get_nr(struct task_struct *task,
>  				  struct pt_regs *regs)
>  {
> -	return current_thread_info()->syscall;
> +	return task_thread_info(task)->syscall;
>  }
>  
>  static inline void mips_syscall_update_nr(struct task_struct *task,
> -- 

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

      reply	other threads:[~2023-02-19  9:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-18 22:43 [PATCH] mips: fix syscall_get_nr Elvira Khabirova
2023-02-19  8:30 ` Thomas Bogendoerfer [this message]

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=20230219083022.GA2924@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=ah@debian.org \
    --cc=jhogan@kernel.org \
    --cc=ldv@strace.io \
    --cc=lineprinter0@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=stable@vger.kernel.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).