Re: [PATCH v2 1/3] powerpc: Don't force ENOSYS as error on syscall fail
From: Michael Ellerman
Date: Thu Feb 12 2015 - 00:24:56 EST
On Wed, 2015-02-11 at 08:36 +0000, Bogdan Purcareata wrote:
> In certain scenarios - e.g. seccomp filtering with ERRNO as default action -
> the system call fails for other reasons than the syscall not being available.
> The seccomp filter can be configured to store a user-defined error code on
> return from a blacklisted syscall. Don't always set ENOSYS on
> do_syscall_trace_enter failure.
> - move setting ENOSYS as errno from the syscall entry assembly to
> do_syscall_trace_enter, only in the specific case
> diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
> index 194e46d..0111e04 100644
> --- a/arch/powerpc/kernel/entry_64.S
> +++ b/arch/powerpc/kernel/entry_64.S
> @@ -269,7 +269,6 @@ syscall_dotrace:
> b .Lsyscall_dotrace_cont
> - li r3,-ENOSYS
> b syscall_exit
This still looks wrong to me.
On 64 bit we do:
Your patch removes the load of ENOSYS.
Which means if we're not doing syscall tracing, and we get an out-of-bounds
syscall number, we'll return with something random on r3. Won't we?
The 32-bit code looks more or less similar, although the label has a different
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/