[PATCH V2] x86/entry: Fix ptrace regression

Sebastian Andrzej Siewior bigeasy at linutronix.de
Mon Nov 2 08:21:13 PST 2026


On 2026-11-01 18:58:08 [+0100], Thomas Gleixner wrote:
> --- a/arch/x86/entry/syscall_32.c
> +++ b/arch/x86/entry/syscall_32.c
> @@ -77,6 +77,10 @@ static __always_inline void do_syscall_3
>  	if (likely(nr < IA32_NR_syscalls)) {
>  		nr = array_index_nospec(nr, IA32_NR_syscalls);
>  		regs->ax = ia32_sys_call(regs, (unsigned int)nr);
> +	} else {
> +		/* See comment in do_syscall_64() */
> +		if (nr != -1UL) {
> +			regs->ax = -ENOSYS;

A curly closing bracket here and then it compiles for me. Or remove the
one in the "if" line.

>  	}
>  }

With either of the suggested changes:
Tested-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>

Sebastian



More information about the linux-riscv mailing list