glibc/ports/sysdeps/unix/sysv/linux/mips
Aurelien Jarno 9480dfe2a3 MIPS: Add wrappers to get/setrlimit64 to fix RLIM64_INFINITY constant
RLIM64_INFINITY was supposed to be a glibc convention rather than
anything seen by the kernel, but it ended being passed to the kernel
through the prlimit64 syscall.  On O32 and N32 ABIs, we therefore
end-up with different values on the userland and kernel side:

* On the kernel side, the value is defined for all architectures as
  include/uapi/linux/resource.h:

  #define RLIM64_INFINITY           (~0ULL)

* On the GNU libc side, the value is defined in
  ports/sysdeps/unix/sysv/linux/mips/bits/resource.h:

  For the O32 and N32 ABI:
  #  define RLIM64_INFINITY 0x7fffffffffffffffULL

  and for the N64 ABI:
  #  define RLIM64_INFINITY 0xffffffffffffffffUL

This was not a problem until the prlimit64 syscall was wired in the
2.6.36 kernel. Given the GLIBC uses the prlimit64 syscall to implement
getrlimit64 and setrlimit64, pam_limits.so is setting the limits to
a very big value instead of infinity. As a normal user process can
later only decrease the value and not increase it, it will later get
and EPERM error when trying to set the value to infinity with setrlimit.

The GLIBC has this constant for more than 7 years, and as it is defined
in a header file, it means a lot of binaries are in the wild. This patch
fixes that by adding a wrapper to fix the value passed to or received
from the kernel, before or after calling the prlimit64 syscall.
2013-11-27 17:36:51 +01:00
..
bits Use __glibc_reserved instead __unused. 2013-11-26 12:32:28 +01:00
mips32
mips64 rename configure.in to configure.ac 2013-10-30 17:32:08 +10:00
nptl
sys
____longjmp_chk.c
_test_and_set.c
brk.c
clone.S
configure rename configure.in to configure.ac 2013-10-30 17:32:08 +10:00
configure.ac rename configure.in to configure.ac 2013-10-30 17:32:08 +10:00
dl-cache.h MIPS: IEEE 754-2008 NaN encoding support 2013-09-18 21:33:50 +01:00
dl-static.c _dl_static_init: Remove nested locking. 2013-06-27 11:49:44 +01:00
getcontext.S
getmsg.c
getrlimit64.c MIPS: Add wrappers to get/setrlimit64 to fix RLIM64_INFINITY constant 2013-11-27 17:36:51 +01:00
getsysstats.c
ipc_priv.h
kernel_rt_sigframe.h
kernel_sigaction.h
kernel_stat.h
kernel_termios.h
kernel-features.h
ldsodefs.h Use ELFOSABI_GNU instead of ELFOSABI_LINUX. 2013-08-29 12:22:17 +02:00
libc-abis
makecontext.S
Makefile MIPS: IEEE 754-2008 NaN encoding support 2013-09-18 21:33:50 +01:00
pipe.S
pread64.c
pread.c
profil-counter.h
putmsg.c
pwrite64.c
pwrite.c
readelflib.c MIPS: IEEE 754-2008 NaN encoding support 2013-09-18 21:33:50 +01:00
register-dump.h
setcontext.S
setrlimit64.c MIPS: Add wrappers to get/setrlimit64 to fix RLIM64_INFINITY constant 2013-11-27 17:36:51 +01:00
sigaction.c
sigcontextinfo.h
swapcontext.S
syscalls.list
ucontext_i.sym
ustat.c
Versions
vfork.S
xstatconv.c