From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
Xi Ruoyao <xry111@xry111.site>
Subject: Re: [PATCH] MIPS: scall: Save thread_info.syscall unconditionally on entry
Date: Tue, 9 Apr 2024 16:59:02 +0200 [thread overview]
Message-ID: <ZhVXtv7CX7CGm3R6@alpha.franken.de> (raw)
In-Reply-To: <20240328-mips_save_syscall-v1-1-9e1d62d6999d@flygoat.com>
On Thu, Mar 28, 2024 at 02:27:56PM +0000, Jiaxun Yang wrote:
> thread_info.syscall is used by syscall_get_nr to supply syscall nr
> over a thread stack frame.
>
> Previously, thread_info.syscall is only saved at syscall_trace_enter
> when syscall tracing is enabled. However rest of the kernel code do
> expect syscall_get_nr to be available without syscall tracing. The
> previous design breaks collect_syscall.
>
> Move saving process to syscall entry to fix it.
>
> Reported-by: Xi Ruoyao <xry111@xry111.site>
> Link: https://github.com/util-linux/util-linux/issues/2867
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> arch/mips/include/asm/ptrace.h | 2 +-
> arch/mips/kernel/asm-offsets.c | 1 +
> arch/mips/kernel/ptrace.c | 15 ++++++---------
> arch/mips/kernel/scall32-o32.S | 23 +++++++++++++----------
> arch/mips/kernel/scall64-n32.S | 3 ++-
> arch/mips/kernel/scall64-n64.S | 3 ++-
> arch/mips/kernel/scall64-o32.S | 33 +++++++++++++++++----------------
> 7 files changed, 42 insertions(+), 38 deletions(-)
applied to mips-fixes.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
prev parent reply other threads:[~2024-04-09 15:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 14:27 [PATCH] MIPS: scall: Save thread_info.syscall unconditionally on entry Jiaxun Yang
2024-04-04 15:07 ` Jiaxun Yang
2024-04-04 15:31 ` Oleg Nesterov
2024-04-09 14:59 ` 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=ZhVXtv7CX7CGm3R6@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=xry111@xry111.site \
/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