Merge changes I06a7b475,Ic7a30b75,Ib22cf72b * changes: trusty: Collect sancov file from confirmationui fuzzer trusty: coverage: Append .<pid>.sancov to sancov file names trusty: fuzz: Explicit errors instead of asserts
diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp index 7938a61..45e555f 100644 --- a/debuggerd/debuggerd_test.cpp +++ b/debuggerd/debuggerd_test.cpp
@@ -16,6 +16,7 @@ #include <err.h> #include <fcntl.h> +#include <malloc.h> #include <stdlib.h> #include <sys/capability.h> #include <sys/mman.h> @@ -32,7 +33,6 @@ #include <android/fdsan.h> #include <android/set_abort_message.h> -#include <bionic/malloc.h> #include <bionic/mte.h> #include <bionic/reserved_signals.h> @@ -385,8 +385,7 @@ #if defined(__aarch64__) static void SetTagCheckingLevelSync() { - HeapTaggingLevel heap_tagging_level = M_HEAP_TAGGING_LEVEL_SYNC; - if (!android_mallopt(M_SET_HEAP_TAGGING_LEVEL, &heap_tagging_level, sizeof(heap_tagging_level))) { + if (mallopt(M_BIONIC_SET_HEAP_TAGGING_LEVEL, M_HEAP_TAGGING_LEVEL_SYNC) == 0) { abort(); } }
diff --git a/fastboot/fastboot.bash b/fastboot/fastboot.bash index 406e8b8..f5a3384 100644 --- a/fastboot/fastboot.bash +++ b/fastboot/fastboot.bash
@@ -109,7 +109,7 @@ cur="${COMP_WORDS[COMP_CWORD]}" if [[ $i -eq $COMP_CWORD ]]; then - partitions="boot bootloader dtbo modem odm odm_dlkm oem product radio recovery system vbmeta vendor vendor_dlkm" + partitions="boot bootloader dtbo modem odm odm_dlkm oem product pvmfw radio recovery system vbmeta vendor vendor_dlkm" COMPREPLY=( $(compgen -W "$partitions" -- $cur) ) else _fastboot_util_complete_local_file "${cur}" '!*.img'
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 62f6ac7..f7edf8e 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp
@@ -147,6 +147,7 @@ { "odm", "odm.img", "odm.sig", "odm", true, ImageType::Normal }, { "odm_dlkm", "odm_dlkm.img", "odm_dlkm.sig", "odm_dlkm", true, ImageType::Normal }, { "product", "product.img", "product.sig", "product", true, ImageType::Normal }, + { "pvmfw", "pvmfw.img", "pvmfw.sig", "pvmfw", true, ImageType::BootCritical }, { "recovery", "recovery.img", "recovery.sig", "recovery", true, ImageType::BootCritical }, { "super", "super.img", "super.sig", "super", true, ImageType::Extra }, { "system", "system.img", "system.sig", "system", false, ImageType::Normal },
diff --git a/healthd/Android.bp b/healthd/Android.bp index b3de9c4..251a45b 100644 --- a/healthd/Android.bp +++ b/healthd/Android.bp
@@ -62,29 +62,6 @@ srcs: [ "HealthServiceDefault.cpp", ], - - overrides: [ - "healthd", - ] -} - -cc_binary { - name: "healthd", - defaults: ["android.hardware.health@2.0-service_defaults"], - - init_rc: ["healthd.rc"], - srcs: [ - "HealthServiceHealthd.cpp", - ], - local_include_dirs: ["include"], - - shared_libs: [ - "android.hardware.health@1.0", - ], - - vintf_fragments: [ - "manifest_healthd.xml" - ], } cc_library_static {
diff --git a/healthd/HealthServiceHealthd.cpp b/healthd/HealthServiceHealthd.cpp deleted file mode 100644 index 5fd2597..0000000 --- a/healthd/HealthServiceHealthd.cpp +++ /dev/null
@@ -1,93 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "healthd" -#include <android-base/logging.h> - -#include <android/hardware/health/1.0/IHealth.h> -#include <android/hardware/health/1.0/types.h> -#include <hal_conversion.h> -#include <health2/service.h> -#include <healthd/healthd.h> -#include <hidl/HidlTransportSupport.h> - -using android::OK; -using android::NAME_NOT_FOUND; -using android::hardware::health::V1_0::HealthConfig; -using android::hardware::health::V1_0::HealthInfo; -using android::hardware::health::V1_0::Result; -using android::hardware::health::V1_0::hal_conversion::convertFromHealthConfig; -using android::hardware::health::V1_0::hal_conversion::convertToHealthConfig; -using android::hardware::health::V1_0::hal_conversion::convertFromHealthInfo; -using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo; - -using IHealthLegacy = android::hardware::health::V1_0::IHealth; - -static android::sp<IHealthLegacy> gHealth_1_0; - -static int healthd_board_get_energy_counter(int64_t* energy) { - if (gHealth_1_0 == nullptr) { - return NAME_NOT_FOUND; - } - - Result result = Result::NOT_SUPPORTED; - gHealth_1_0->energyCounter([energy, &result](Result ret, int64_t energyOut) { - result = ret; - *energy = energyOut; - }); - - return result == Result::SUCCESS ? OK : NAME_NOT_FOUND; -} - -void healthd_board_init(struct healthd_config* config) { - gHealth_1_0 = IHealthLegacy::getService(); - - if (gHealth_1_0 == nullptr) { - return; - } - - HealthConfig halConfig{}; - convertToHealthConfig(config, halConfig); - gHealth_1_0->init(halConfig, [config](const auto& halConfigOut) { - convertFromHealthConfig(halConfigOut, config); - // always redirect energy counter queries - config->energyCounter = healthd_board_get_energy_counter; - }); - LOG(INFO) << LOG_TAG << ": redirecting calls to 1.0 health HAL"; -} - -// TODO(b/68724651): Move this function into healthd_mode_service_2_0_battery_update -// with logthis returned. -int healthd_board_battery_update(struct android::BatteryProperties* props) { - int logthis = 0; - - if (gHealth_1_0 == nullptr) { - return logthis; - } - - HealthInfo info; - convertToHealthInfo(props, info); - gHealth_1_0->update(info, [props, &logthis](int32_t ret, const auto& infoOut) { - logthis = ret; - convertFromHealthInfo(infoOut, props); - }); - - return logthis; -} - -int main() { - return health_service_main("backup"); -}
diff --git a/healthd/manifest_healthd.xml b/healthd/manifest_healthd.xml deleted file mode 100644 index 097a7d8..0000000 --- a/healthd/manifest_healthd.xml +++ /dev/null
@@ -1,11 +0,0 @@ -<manifest version="1.0" type="framework"> - <hal> - <name>android.hardware.health</name> - <transport>hwbinder</transport> - <version>2.0</version> - <interface> - <name>IHealth</name> - <instance>backup</instance> - </interface> - </hal> -</manifest>
diff --git a/libcutils/Android.bp b/libcutils/Android.bp index cf809f1..d46aeab 100644 --- a/libcutils/Android.bp +++ b/libcutils/Android.bp
@@ -210,9 +210,6 @@ "uevent.cpp", ], }, - bionic: { - header_libs: ["bionic_libc_platform_headers"], - }, android_arm: { sanitize: {
diff --git a/libcutils/memory.cpp b/libcutils/memory.cpp index f526520..a899d80 100644 --- a/libcutils/memory.cpp +++ b/libcutils/memory.cpp
@@ -18,19 +18,16 @@ #include <log/log.h> -#ifdef __BIONIC__ -#include <bionic/malloc.h> -#endif +#include <malloc.h> void process_disable_memory_mitigations() { bool success = false; #ifdef __BIONIC__ - // TODO(b/158870657) is fixed and scudo is used globally, we can assert when an - // an error is returned. - - success = android_mallopt(M_DISABLE_MEMORY_MITIGATIONS, nullptr, 0); + success = mallopt(M_BIONIC_DISABLE_MEMORY_MITIGATIONS, 0); #endif + // TODO: if b/158870657 is fixed and scudo is used globally, + // we can assert on failure rather than just log. if (success) { ALOGI("Disabled memory mitigations for process."); } else {