Chromium Code Reviews
DescriptionLinux Sandbox: Whitelist prlimit64 when used as getrlimit
From http://man7.org/linux/man-pages/man2/getrlimit.2.html:
The Linux-specific prlimit() system call combines and extends the
functionality of setrlimit() and getrlimit(). It can be used to both
set and get the resource limits of an arbitrary process.
Since version 2.13, the glibc getrlimit() and setrlimit() wrapper
functions no longer invoke the corresponding system calls, but
instead employ prlimit(), for the reasons described in BUGS.
If new_limit is not NULL, then the rlimit structure to which it points is
used to set new values. If it is NULL, then prlimit() acts as getrlimit().
So, allow prlimit() with new_limit=NULL, and pid is the current process
(or 0), so the glib implementation of getrlimit can succeed.
BUG=chromium:662450
TEST=boot on ChromeOS w/ sandbox enabled
No messages like:
getrlimit(RLIMIT_NOFILE) failed
NOTRY=true
NOPRESUBMIT=true
Review-Url: https://codereview.chromium.org/2484393004
Cr-Commit-Position: refs/heads/master@{#434872}
(cherry picked from commit 5ce3b357d4cb9906b57f5758ef271cb69dbb664b)
Patch Set 1 #
Messages
Total messages: 13 (9 generated)
|
|||||||||||||||||||||||||||||||||||||