linux/arch/powerpc/include/uapi/asm
Michael Ellerman c3525940cc 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>
2015-07-29 11:56:11 +10:00
..
auxvec.h
bitsperlong.h
bootx.h
byteorder.h powerpc: Include the appropriate endianness header 2013-10-11 16:48:33 +11:00
cputable.h powerpc/tm: Abort syscalls in active transactions 2015-06-19 17:10:28 +10:00
eeh.h powerpc/eeh: Introduce eeh_pe_inject_err() 2015-05-12 20:33:35 +10:00
elf.h powerpc: Handle new ELFv2 module relocations 2014-04-23 10:05:29 +10:00
epapr_hcalls.h PPC: ePAPR: Convert hcall header to uapi (round 2) 2012-10-31 13:45:32 +01:00
errno.h powerpc/kernel: Switch to using MAX_ERRNO 2015-07-29 11:56:11 +10:00
fcntl.h
ioctl.h
ioctls.h tty, ioctls -- Add new ioctl definitions for tty flags fetching 2012-10-25 12:07:18 -07:00
ipcbuf.h
Kbuild powerpc/include: Add opal-prd to installed uapi headers 2015-06-18 07:16:02 +10:00
kvm_para.h KVM: PPC: Disable NX for old magic page using guests 2014-05-30 14:26:24 +02:00
kvm.h KVM: PPC: Move ONE_REG AltiVec support to powerpc 2014-09-22 10:11:33 +02:00
mman.h
msgbuf.h
nvram.h
opal-prd.h powerpc/powernv: Add opal-prd channel 2015-06-05 08:32:21 +10:00
param.h
perf_event.h powerpc/perf: Export PERF_EVENT_CONFIG_EBB_SHIFT to userspace 2013-08-01 13:11:46 +10:00
poll.h
posix_types.h
ps3fb.h
ptrace.h powerpc: Change vrX register defines to vX to match gcc and glibc 2015-03-16 18:32:11 +11:00
resource.h
sembuf.h
setup.h powerpc: Bump COMMAND_LINE_SIZE to 2048 2014-04-28 16:31:58 +10:00
shmbuf.h
sigcontext.h powerpc/signal: Fix confusing header documentation in sigcontext.h 2015-07-16 16:14:40 +10:00
siginfo.h
signal.h powerpc: switch to generic old sigaction() 2013-02-03 18:16:10 -05:00
socket.h net: sock: allow eBPF programs to be attached to sockets 2014-12-05 21:47:32 -08:00
sockios.h
spu_info.h
stat.h
statfs.h
swab.h
termbits.h
termios.h
tm.h powerpc/tm: Abort syscalls in active transactions 2015-06-19 17:10:28 +10:00
types.h
ucontext.h
unistd.h powerpc: Add a proper syscall for switching endianness 2015-03-28 22:03:40 +11:00