Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d2f9e0c authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

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

Merge "zygote: don't drop CAP_SYS_PTRACE from the bounding set." am: 273b886c am: e8018105 am: a07e5312
am: 0ebf87e3

Change-Id: Ic99476b698ccc056eb97f83d64e844c3fffa481f
parents 40832f9b 0ebf87e3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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) {