diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2015-07-23 20:21:01 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-07-29 11:56:11 +1000 |
commit | c3525940cca53cf3568fefd35d169fea4f107f0a (patch) | |
tree | ba6968be2c8b3914157f52ac05961c1e723913d6 /arch/powerpc/include | |
parent | f0322f7f1e2165fbf83530a424ef6ebeacbf4bca (diff) | |
download | blackbird-obmc-linux-c3525940cca53cf3568fefd35d169fea4f107f0a.tar.gz blackbird-obmc-linux-c3525940cca53cf3568fefd35d169fea4f107f0a.zip |
powerpc/kernel: Switch to using MAX_ERRNO
Currently on powerpc we have our own #define for the highest (negative)
errno value, called _LAST_ERRNO. This is defined to be 516, for reasons
which are not clear.
The generic code, and x86, use MAX_ERRNO, which is defined to be 4095.
In particular seccomp uses MAX_ERRNO to restrict the value that a
seccomp filter can return.
Currently with the mismatch between _LAST_ERRNO and MAX_ERRNO, a seccomp
tracer wanting to return 600, expecting it to be seen as an error, would
instead find on powerpc that userspace sees a successful syscall with a
return value of 600.
To avoid this inconsistency, switch powerpc to use MAX_ERRNO.
We are somewhat confident that generic syscalls that can return a
non-error value above negative MAX_ERRNO have already been updated to
use force_successful_syscall_return().
I have also checked all the powerpc specific syscalls, and believe that
none of them expect to return a non-error value between -MAX_ERRNO and
-516. So this change should be safe ...
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/uapi/asm/errno.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/powerpc/include/uapi/asm/errno.h b/arch/powerpc/include/uapi/asm/errno.h index 8c145fd17d86..e8b6b5f7de7c 100644 --- a/arch/powerpc/include/uapi/asm/errno.h +++ b/arch/powerpc/include/uapi/asm/errno.h @@ -6,6 +6,4 @@ #undef EDEADLOCK #define EDEADLOCK 58 /* File locking deadlock error */ -#define _LAST_ERRNO 516 - #endif /* _ASM_POWERPC_ERRNO_H */ |