Issue metadata
Sign in to add a comment
|
coreutils crashes with glibc 2.27 |
||||||||||||||||||||||||
Issue description
coreutils crashes with glibc 2.27.
It crashes with SIGSYS, Bad system call.
#0 0x000076b33ea85980 in __GI___getrlimit64 (
int
__getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
{
return INLINE_SYSCALL_CALL (prlimit64, 0, resource, NULL, rlimits);
}
libc_hidden_def (__getrlimit64)
Maybe this is related to glibc commit ?
commit 695d7d138eda449678a1650a8b8b58181033353f
Author: Joseph Myers <joseph@codesourcery.com>
Date: Tue May 9 14:05:09 2017 +0000
Assume prlimit64 is available.
This patch makes sysdeps/unix/sysv/linux code assume the prlimit64
syscall is always available, given the minimum of a 3.2 kernel.
__ASSUME_PRLIMIT64, which in fact was no longer used, is removed.
Code conditional on __NR_prlimit64 being defined is made
unconditional. Fallback code for the case where prlimit64 produces an
ENOSYS error is removed, substantially simplifying some functions.
Tested for x86_64 and x86.
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PRLIMIT64):
Remove macro.
* sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Assume
prlimit64 is always available and does not give an ENOSYS error.
* sysdeps/unix/sysv/linux/prlimit.c [__NR_prlimit64]: Make code
unconditional.
[!__NR_prlimit64]: Remove conditional code.
* sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Assume
prlimit64 is always available and does not give an ENOSYS error.
* sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit64): Likewise.
,
Oct 12
SIGSYS is seccomp. who ran the program?. my guess is mosys ...
,
Oct 13
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/mosys/+/8ecca55c71dd2493cf733c2de4b7f72143b9eea5 commit 8ecca55c71dd2493cf733c2de4b7f72143b9eea5 Author: Yunlian Jiang <yunlian@google.com> Date: Sat Oct 13 18:42:17 2018 mosys: whitelist prlimit64 in seccomp This whitelist prlimit64 in seccomp because coreutils is calling this system call. BUG= chromium:894936 TEST=no crash on coreutils Change-Id: Ie683190f728d2981b813a433b422ea276ca7a1c9 Reviewed-on: https://chromium-review.googlesource.com/1279110 Commit-Ready: Yunlian Jiang <yunlian@chromium.org> Tested-by: Yunlian Jiang <yunlian@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/8ecca55c71dd2493cf733c2de4b7f72143b9eea5/seccomp/mosys-seccomp-arm64.policy [modify] https://crrev.com/8ecca55c71dd2493cf733c2de4b7f72143b9eea5/seccomp/mosys-seccomp-amd64.policy
,
Oct 15
,
Oct 15
,
Oct 16
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/mosys/+/eab6da95eb591be1447f1342411f522f0e2685fc commit eab6da95eb591be1447f1342411f522f0e2685fc Author: Yunlian Jiang <yunlian@google.com> Date: Tue Oct 16 09:57:28 2018 mosys: whitelist prlimit64 in seccomp This whitelist prlimit64 in seccomp because coreutils is calling this system call. The api for prlimit is int prlimit(pid_t pid, int resource, const struct rlimit *new_limit, struct rlimit *old_limit); To block setrlimit, we need to allow calls where *new_limit is NULL. BUG= chromium:894936 TEST=no crash on coreutils Change-Id: I8c6aff7dd7106846d88e7142350b6b6fbca51667 Reviewed-on: https://chromium-review.googlesource.com/1281364 Commit-Ready: Yunlian Jiang <yunlian@chromium.org> Tested-by: Yunlian Jiang <yunlian@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/eab6da95eb591be1447f1342411f522f0e2685fc/seccomp/mosys-seccomp-arm64.policy [modify] https://crrev.com/eab6da95eb591be1447f1342411f522f0e2685fc/seccomp/mosys-seccomp-amd64.policy |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by yunlian@chromium.org
, Oct 12