debuggerd_handler: don't dump PR_NO_NEW_PRIVS processes. am: 7e14d020f1
am: 44212f19a5
Change-Id: If49cce292c620b9dca8e89b22544f594960c1979
diff --git a/debuggerd/handler/debuggerd_handler.cpp b/debuggerd/handler/debuggerd_handler.cpp
index 1af0bd1..c009869 100644
--- a/debuggerd/handler/debuggerd_handler.cpp
+++ b/debuggerd/handler/debuggerd_handler.cpp
@@ -301,7 +301,14 @@
// The process has disabled core dumps and PTRACE_ATTACH, and does not want to be dumped.
__libc_format_log(ANDROID_LOG_INFO, "libc",
"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);
return;
}