]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
MIPS: scall: Save thread_info.syscall unconditionally on entry
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Thu, 28 Mar 2024 14:27:56 +0000 (14:27 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 10:14:45 +0000 (12:14 +0200)
commitb6628a94f7e4938bf5d30c2d7c5a36f779fdfe8d
treed5f013bf8ba7fb2760cd2179fe62f62622d37c80
parentcefd8733ecbc4a0ff850e648b835666ec0304a07
MIPS: scall: Save thread_info.syscall unconditionally on entry

[ Upstream commit 4370b673ccf240bf7587b0cb8e6726a5ccaf1f17 ]

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>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/include/asm/ptrace.h
arch/mips/kernel/asm-offsets.c
arch/mips/kernel/ptrace.c
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-n64.S
arch/mips/kernel/scall64-o32.S