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

am: e801810553

Change-Id: I636c0f021c6ffae4518d889b1e7c4c3c29c6e864
This commit is contained in:
Josh Gao
2017-01-25 21:25:23 +00:00
committed by android-build-merger

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) {