diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-03 18:03:29 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-03 18:03:29 +0000 |
commit | d70a7149c7d86377a38c8c49761daf1386ff81d3 (patch) | |
tree | 487ab29813e2534e577b81467850802a3cfa6b46 | |
parent | 1267a75d32f872abd7288cf87cf6f4472ce587f8 (diff) | |
parent | ae2837d80cfc64ae0c5a12737d4b480a479adb20 (diff) | |
download | core-d70a7149c7d86377a38c8c49761daf1386ff81d3.tar.gz |
Snap for 8680211 from ae2837d80cfc64ae0c5a12737d4b480a479adb20 to mainline-go-adservices-releaseaml_go_ads_330915100aml_go_ads_330915000aml_go_ads_330913000android13-mainline-go-adservices-release
Change-Id: I8bb5db9ee42dc3ba4603d772d6ca646affa128fd
-rw-r--r-- | debuggerd/debuggerd_test.cpp | 23 | ||||
-rw-r--r-- | debuggerd/libdebuggerd/tombstone_proto.cpp | 2 | ||||
-rw-r--r-- | fs_mgr/tests/vts_fs_test.cpp | 10 | ||||
-rw-r--r-- | init/service.cpp | 4 | ||||
-rw-r--r-- | init/snapuserd_transition.cpp | 10 | ||||
-rw-r--r-- | libcutils/include/private/android_filesystem_config.h | 1 | ||||
-rw-r--r-- | libutils/Android.bp | 4 | ||||
-rw-r--r-- | storaged/storaged.cpp | 2 | ||||
-rw-r--r-- | trusty/utils/acvp/acvp_ipc.h | 2 |
9 files changed, 54 insertions, 4 deletions
diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp index f4ba34790..e11330819 100644 --- a/debuggerd/debuggerd_test.cpp +++ b/debuggerd/debuggerd_test.cpp @@ -1463,6 +1463,29 @@ TEST_F(CrasherTest, seccomp_tombstone) { ASSERT_BACKTRACE_FRAME(result, "bar"); } +TEST_F(CrasherTest, seccomp_tombstone_thread_abort) { + int intercept_result; + unique_fd output_fd; + + static const auto dump_type = kDebuggerdTombstone; + StartProcess( + []() { + std::thread abort_thread([] { abort(); }); + abort_thread.join(); + }, + &seccomp_fork); + + StartIntercept(&output_fd, dump_type); + FinishCrasher(); + AssertDeath(SIGABRT); + FinishIntercept(&intercept_result); + ASSERT_EQ(1, intercept_result) << "tombstoned reported failure"; + + std::string result; + ConsumeFd(std::move(output_fd), &result); + ASSERT_BACKTRACE_FRAME(result, "abort"); +} + TEST_F(CrasherTest, seccomp_backtrace) { int intercept_result; unique_fd output_fd; diff --git a/debuggerd/libdebuggerd/tombstone_proto.cpp b/debuggerd/libdebuggerd/tombstone_proto.cpp index bee4a67c9..bd05837a5 100644 --- a/debuggerd/libdebuggerd/tombstone_proto.cpp +++ b/debuggerd/libdebuggerd/tombstone_proto.cpp @@ -455,7 +455,7 @@ static void dump_thread(Tombstone* tombstone, unwindstack::Unwinder* unwinder, thread.set_tagged_addr_ctrl(thread_info.tagged_addr_ctrl); thread.set_pac_enabled_keys(thread_info.pac_enabled_keys); - if (thread_info.pid == getpid() && thread_info.pid != thread_info.tid) { + if (thread_info.registers == nullptr) { // Fallback path for non-main thread, doing unwind from running process. unwindstack::ThreadUnwinder thread_unwinder(kMaxFrames, unwinder->GetMaps()); if (!thread_unwinder.Init()) { diff --git a/fs_mgr/tests/vts_fs_test.cpp b/fs_mgr/tests/vts_fs_test.cpp index b5fac53af..aac2cfd9b 100644 --- a/fs_mgr/tests/vts_fs_test.cpp +++ b/fs_mgr/tests/vts_fs_test.cpp @@ -47,6 +47,8 @@ TEST(fs, ErofsSupported) { std::string fs; ASSERT_TRUE(android::base::ReadFileToString("/proc/filesystems", &fs)); EXPECT_THAT(fs, ::testing::HasSubstr("\terofs\n")); + + ASSERT_EQ(access("/sys/fs/erofs", F_OK), 0); } TEST(fs, PartitionTypes) { @@ -94,7 +96,13 @@ TEST(fs, PartitionTypes) { } if (entry.flags & MS_RDONLY) { - EXPECT_EQ(entry.fs_type, "erofs") << entry.mount_point; + std::vector<std::string> allowed = {"erofs", "ext4"}; + if (vsr_level == __ANDROID_API_T__) { + allowed.emplace_back("f2fs"); + } + + EXPECT_NE(std::find(allowed.begin(), allowed.end(), entry.fs_type), allowed.end()) + << entry.mount_point; } else { EXPECT_NE(entry.fs_type, "ext4") << entry.mount_point; } diff --git a/init/service.cpp b/init/service.cpp index 3fa935fdd..bd704cf8e 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -547,6 +547,10 @@ Result<void> Service::Start() { if ((flags_ & SVC_ONESHOT) && disabled) { flags_ |= SVC_RESTART; } + + LOG(INFO) << "service '" << name_ + << "' requested start, but it is already running (flags: " << flags_ << ")"; + // It is not an error to try to start a service that is already running. reboot_on_failure.Disable(); return {}; diff --git a/init/snapuserd_transition.cpp b/init/snapuserd_transition.cpp index 5deaf3156..5c821b05c 100644 --- a/init/snapuserd_transition.cpp +++ b/init/snapuserd_transition.cpp @@ -29,6 +29,7 @@ #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/parseint.h> +#include <android-base/stringprintf.h> #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <cutils/sockets.h> @@ -40,6 +41,7 @@ #include <snapuserd/snapuserd_client.h> #include "block_dev_initializer.h" +#include "lmkd_service.h" #include "service_utils.h" #include "util.h" @@ -320,6 +322,14 @@ void SnapuserdSelinuxHelper::RelaunchFirstStageSnapuserd() { LOG(INFO) << "Relaunched snapuserd with pid: " << pid; + // Since daemon is not started as a service, we have + // to explicitly set the OOM score to default which is unkillable + std::string oom_str = std::to_string(DEFAULT_OOM_SCORE_ADJUST); + std::string oom_file = android::base::StringPrintf("/proc/%d/oom_score_adj", pid); + if (!android::base::WriteStringToFile(oom_str, oom_file)) { + PLOG(ERROR) << "couldn't write oom_score_adj to snapuserd daemon with pid: " << pid; + } + if (!TestSnapuserdIsReady()) { PLOG(FATAL) << "snapuserd daemon failed to launch"; } else { diff --git a/libcutils/include/private/android_filesystem_config.h b/libcutils/include/private/android_filesystem_config.h index 8bb8652b0..bdb807538 100644 --- a/libcutils/include/private/android_filesystem_config.h +++ b/libcutils/include/private/android_filesystem_config.h @@ -137,6 +137,7 @@ #define AID_JC_STRONGBOX 1088 /* Javacard Strongbox HAL - to manage omapi ARA rules */ #define AID_JC_IDENTITYCRED 1089 /* Javacard Identity Cred HAL - to manage omapi ARA rules */ #define AID_SDK_SANDBOX 1090 /* SDK sandbox virtual UID */ +#define AID_SECURITY_LOG_WRITER 1091 /* write to security log */ /* Changes to this file must be made in AOSP, *not* in internal branches. */ #define AID_SHELL 2000 /* adb and debug shell user */ diff --git a/libutils/Android.bp b/libutils/Android.bp index 7d6a6c538..019a3687a 100644 --- a/libutils/Android.bp +++ b/libutils/Android.bp @@ -182,6 +182,10 @@ cc_library { min_sdk_version: "apex_inherit", afdo: true, + + header_abi_checker: { + diff_flags: ["-allow-adding-removing-weak-symbols"], + }, } cc_library { diff --git a/storaged/storaged.cpp b/storaged/storaged.cpp index 8cc8b596e..cefef6e06 100644 --- a/storaged/storaged.cpp +++ b/storaged/storaged.cpp @@ -333,7 +333,7 @@ void storaged_t::flush_proto_data(userid_t user_id, first_write = false; } - if (benchmark_size) { + if (benchmark_size && benchmark_time_ns) { int perf = benchmark_size * 1000000LLU / benchmark_time_ns; storage_info->update_perf_history(perf, system_clock::now()); } diff --git a/trusty/utils/acvp/acvp_ipc.h b/trusty/utils/acvp/acvp_ipc.h index 8b48ae3cd..300e05acf 100644 --- a/trusty/utils/acvp/acvp_ipc.h +++ b/trusty/utils/acvp/acvp_ipc.h @@ -27,7 +27,7 @@ extern "C" { /* * Maximum number of arguments */ -#define ACVP_MAX_NUM_ARGUMENTS 8 +#define ACVP_MAX_NUM_ARGUMENTS 9 /* * Maximum length of an algorithm name |