lkml.org 
[lkml]   [2024]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] MIPS: scall: Save thread_info.syscall unconditionally on entry
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 ]

\
 
 \ /
  Last update: 2024-05-27 16:31    [W:0.051 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site