Merge "zygote: don't drop CAP_SYS_PTRACE from the bounding set."

This commit is contained in:
Josh Gao
2017-01-25 21:16:57 +00:00
committed by Gerrit Code Review

View File

@@ -247,6 +247,11 @@ static void EnableKeepCapabilities(JNIEnv* env) {
static void DropCapabilitiesBoundingSet(JNIEnv* env) {
for (int i = 0; prctl(PR_CAPBSET_READ, i, 0, 0, 0) >= 0; i++) {
// Keep CAP_SYS_PTRACE in our bounding set so crash_dump can gain it.
if (i == CAP_SYS_PTRACE) {
continue;
}
int rc = prctl(PR_CAPBSET_DROP, i, 0, 0, 0);
if (rc == -1) {
if (errno == EINVAL) {