summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Vuillaumier <jvuillaumier@nvidia.com>2015-01-22 13:42:58 +0000
committerMichael Bestas <mikeioannina@gmail.com>2015-01-25 16:47:17 +0200
commita28b67c7ec595e55a4ff083b8b270dfd5f74a889 (patch)
treebe212a2a98690fde2927d3fe44645003e1a06023
parente01a4068b559939dbb28e43c148bc04e4bf6849e (diff)
downloadandroid_hardware_ril-stable/cm-12.0-YNG1T.tar.gz
android_hardware_ril-stable/cm-12.0-YNG1T.tar.bz2
android_hardware_ril-stable/cm-12.0-YNG1T.zip
Since Android L, process dumpable flag is verified in case of crash before requesting tombstone capture by debuggerd. As setuid operation clears dumpable flag for a process, reenable flag in rild after its switch to UID radio (debuggable build only) Change-Id: Id86b697e2a1e11744ccc50a3c9ef04faf079ed94
-rw-r--r--rild/rild.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/rild/rild.c b/rild/rild.c
index 88469b3..ef88ad3 100644
--- a/rild/rild.c
+++ b/rild/rild.c
@@ -96,6 +96,8 @@ static int make_argv(char * args, char ** argv)
* Our group, cache, was set by init.
*/
void switchUser() {
+ char debuggable[PROP_VALUE_MAX];
+
prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
setuid(AID_RADIO);
@@ -117,6 +119,15 @@ void switchUser() {
RLOGE("capset failed: %s", strerror(errno));
exit(EXIT_FAILURE);
}
+
+ /*
+ * Debuggable build only:
+ * Set DUMPABLE that was cleared by setuid() to have tombstone on RIL crash
+ */
+ property_get("ro.debuggable", debuggable, "0");
+ if (strcmp(debuggable, "1") == 0) {
+ prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+ }
}
int main(int argc, char **argv)