summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debuggerd/debuggerd_test.cpp21
-rw-r--r--debuggerd/libdebuggerd/tombstone.cpp2
-rw-r--r--debuggerd/libdebuggerd/utility.cpp4
-rw-r--r--rootdir/init.rc6
4 files changed, 24 insertions, 9 deletions
diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp
index 65820bda5..12d5d5242 100644
--- a/debuggerd/debuggerd_test.cpp
+++ b/debuggerd/debuggerd_test.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <dirent.h>
#include <err.h>
#include <fcntl.h>
#include <malloc.h>
@@ -1444,9 +1445,16 @@ TEST(tombstoned, proto) {
std::this_thread::sleep_for(100ms);
// Find the tombstone.
- std::optional<int> tombstone_index;
- for (int i = 0; i < 50; ++i) {
- std::string path = android::base::StringPrintf("/data/tombstones/tombstone_%02d", i);
+ std::optional<std::string> tombstone_file;
+ std::unique_ptr<DIR, decltype(&closedir)> dir_h(opendir("/data/tombstones"), closedir);
+ ASSERT_TRUE(dir_h != nullptr);
+ std::regex tombstone_re("tombstone_\\d+");
+ dirent* entry;
+ while ((entry = readdir(dir_h.get())) != nullptr) {
+ if (!std::regex_match(entry->d_name, tombstone_re)) {
+ continue;
+ }
+ std::string path = android::base::StringPrintf("/data/tombstones/%s", entry->d_name);
struct stat st;
if (TEMP_FAILURE_RETRY(stat(path.c_str(), &st)) != 0) {
@@ -1454,14 +1462,13 @@ TEST(tombstoned, proto) {
}
if (st.st_dev == text_st.st_dev && st.st_ino == text_st.st_ino) {
- tombstone_index = i;
+ tombstone_file = path;
break;
}
}
- ASSERT_TRUE(tombstone_index);
- std::string proto_path =
- android::base::StringPrintf("/data/tombstones/tombstone_%02d.pb", *tombstone_index);
+ ASSERT_TRUE(tombstone_file);
+ std::string proto_path = tombstone_file.value() + ".pb";
struct stat proto_fd_st;
struct stat proto_file_st;
diff --git a/debuggerd/libdebuggerd/tombstone.cpp b/debuggerd/libdebuggerd/tombstone.cpp
index 185bd6e73..c1a59d85c 100644
--- a/debuggerd/libdebuggerd/tombstone.cpp
+++ b/debuggerd/libdebuggerd/tombstone.cpp
@@ -619,7 +619,7 @@ void engrave_tombstone(unique_fd output_fd, unique_fd proto_fd, unwindstack::Unw
log.tfd = output_fd.get();
log.amfd_data = amfd_data;
- bool translate_proto = GetBoolProperty("debug.debuggerd.translate_proto_to_text", false);
+ bool translate_proto = GetBoolProperty("debug.debuggerd.translate_proto_to_text", true);
if (translate_proto) {
tombstone_proto_to_text(tombstone, [&log](const std::string& line, bool should_log) {
_LOG(&log, should_log ? logtype::HEADER : logtype::LOGS, "%s\n", line.c_str());
diff --git a/debuggerd/libdebuggerd/utility.cpp b/debuggerd/libdebuggerd/utility.cpp
index f941990d0..6f13ed4c2 100644
--- a/debuggerd/libdebuggerd/utility.cpp
+++ b/debuggerd/libdebuggerd/utility.cpp
@@ -391,8 +391,10 @@ const char* get_sigcode(const siginfo_t* si) {
case SIGSYS:
switch (si->si_code) {
case SYS_SECCOMP: return "SYS_SECCOMP";
+ case SYS_USER_DISPATCH:
+ return "SYS_USER_DISPATCH";
}
- static_assert(NSIGSYS == SYS_SECCOMP, "missing SYS_* si_code");
+ static_assert(NSIGSYS == SYS_USER_DISPATCH, "missing SYS_* si_code");
break;
case SIGTRAP:
switch (si->si_code) {
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 863cf6caf..68a76f1e7 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -738,6 +738,8 @@ on post-fs-data
mkdir /data/misc/snapshotctl_log 0755 root root
# create location to store pre-reboot information
mkdir /data/misc/prereboot 0700 system system
+ # directory used for on-device signing key blob
+ mkdir /data/misc/odsign 0700 root root
mkdir /data/preloads 0775 system system encryption=None
@@ -877,6 +879,10 @@ on post-fs-data
# Set SELinux security contexts on upgrade or policy update.
restorecon --recursive --skip-ce /data
+ # Start the on-device signing daemon, and wait for it to finish, to ensure
+ # ART artifacts are generated if needed.
+ exec_start odsign
+
# After apexes are mounted, tell keymaster early boot has ended, so it will
# stop allowing use of early-boot keys
exec - system system -- /system/bin/vdc keymaster earlyBootEnded