logd: clear DUMPABLE

Do not allow anyone to see logd memory.

Test: gTest logd-unit-tests, liblog-unit-tests and logcat-unit-tests
Bug: 32450474
Change-Id: Ic7377efcb7e1d3cd91b50741061037a0fb589045
This commit is contained in:
Mark Salyzyn 2016-10-28 14:49:53 -07:00
parent 3a724a8f5d
commit 6a70ded7bf

View file

@ -106,6 +106,11 @@ static int drop_privs() {
return -1;
}
if (prctl(PR_SET_DUMPABLE, 0) < 0) {
android::prdebug("failed to clear PR_SET_DUMPABLE");
return -1;
}
gid_t groups[] = { AID_READPROC };
ScopedMinijail j(minijail_new());
minijail_set_supplementary_gids(j.get(), arraysize(groups), groups);