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

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

debuggerd_handler: don't dump PR_NO_NEW_PRIVS processes. am: 7e14d020 am: 44212f19

am: 43308bb3

Change-Id: I4f6afdc411c17feb83147ae74809db3018a00783
parents e237b390 43308bb3
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -301,7 +301,14 @@ static void debuggerd_signal_handler(int signal_number, siginfo_t* info, void*)
    // The process has disabled core dumps and PTRACE_ATTACH, and does not want to be dumped.
    // The process has disabled core dumps and PTRACE_ATTACH, and does not want to be dumped.
    __libc_format_log(ANDROID_LOG_INFO, "libc",
    __libc_format_log(ANDROID_LOG_INFO, "libc",
                      "Suppressing debuggerd output because prctl(PR_GET_DUMPABLE)==0");
                      "Suppressing debuggerd output because prctl(PR_GET_DUMPABLE)==0");
    resend_signal(info, false);
    return;
  }


  if (prctl(PR_GET_NO_NEW_PRIVS, 0, 0, 0, 0) == 1) {
    // The process has NO_NEW_PRIVS enabled, so we can't transition to the crash_dump context.
    __libc_format_log(ANDROID_LOG_INFO, "libc",
                      "Suppressing debuggerd output because prctl(PR_GET_NO_NEW_PRIVS)==1");
    resend_signal(info, false);
    resend_signal(info, false);
    return;
    return;
  }
  }