Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7cb2ed2 authored by Hongguang Chen's avatar Hongguang Chen Committed by Automerger Merge Worker
Browse files

Merge "Use more inclusive language for #inclusivefixit" am: 628f288f am:...

Merge "Use more inclusive language for #inclusivefixit" am: 628f288f am: 16028dbe am: 8af7bfad

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1371397

Change-Id: I5a82974b813913d978bcd7eef152a2e45f25af68
parents dbc09c6b 8af7bfad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ namespace fiemap {

using namespace android::dm;

// We cap the maximum number of extents as a sanity measure.
// We cap the maximum number of extents as a robustness measure.
static constexpr uint32_t kMaxExtents = 50000;

// TODO: Fallback to using fibmap if FIEMAP_EXTENT_MERGED is set.
+1 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ bool SplitFiemap::Write(const void* data, uint64_t bytes) {
        cursor_file_pos_ += bytes_to_write;
    }

    // If we've reached the end of the current file, close it for sanity.
    // If we've reached the end of the current file, close it.
    if (cursor_file_pos_ == file->size()) {
        cursor_fd_ = {};
    }
+1 −2
Original line number Diff line number Diff line
@@ -139,8 +139,7 @@ bool BlockDeviceToName(uint32_t major, uint32_t minor, std::string* bdev_name) {
    }

    *bdev_name = ::android::base::Basename(sysfs_bdev);
    // Paranoid sanity check to make sure we just didn't get the
    // input in return as-is.
    // Check that the symlink doesn't point to itself.
    if (sysfs_bdev == *bdev_name) {
        LOG(ERROR) << "Malformed symlink for block device: " << sysfs_bdev;
        return false;
+18 −18
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ static AvbIOResult read_from_partition(AvbOps* ops, const char* partition, int64
            partition, offset, num_bytes, buffer, out_num_read);
}

static AvbIOResult dummy_read_rollback_index(AvbOps* ops ATTRIBUTE_UNUSED,
static AvbIOResult no_op_read_rollback_index(AvbOps* ops ATTRIBUTE_UNUSED,
                                            size_t rollback_index_location ATTRIBUTE_UNUSED,
                                            uint64_t* out_rollback_index) {
    // rollback_index has been checked in bootloader phase.
@@ -61,7 +61,7 @@ static AvbIOResult dummy_read_rollback_index(AvbOps* ops ATTRIBUTE_UNUSED,
    return AVB_IO_RESULT_OK;
}

static AvbIOResult dummy_validate_vbmeta_public_key(
static AvbIOResult no_op_validate_vbmeta_public_key(
        AvbOps* ops ATTRIBUTE_UNUSED, const uint8_t* public_key_data ATTRIBUTE_UNUSED,
        size_t public_key_length ATTRIBUTE_UNUSED,
        const uint8_t* public_key_metadata ATTRIBUTE_UNUSED,
@@ -76,7 +76,7 @@ static AvbIOResult dummy_validate_vbmeta_public_key(
    return AVB_IO_RESULT_OK;
}

static AvbIOResult dummy_read_is_device_unlocked(AvbOps* ops ATTRIBUTE_UNUSED,
static AvbIOResult no_op_read_is_device_unlocked(AvbOps* ops ATTRIBUTE_UNUSED,
                                                bool* out_is_unlocked) {
    // The function is for bootloader to update the value into
    // androidboot.vbmeta.device_state in kernel cmdline.
@@ -85,7 +85,7 @@ static AvbIOResult dummy_read_is_device_unlocked(AvbOps* ops ATTRIBUTE_UNUSED,
    return AVB_IO_RESULT_OK;
}

static AvbIOResult dummy_get_unique_guid_for_partition(AvbOps* ops ATTRIBUTE_UNUSED,
static AvbIOResult no_op_get_unique_guid_for_partition(AvbOps* ops ATTRIBUTE_UNUSED,
                                                      const char* partition ATTRIBUTE_UNUSED,
                                                      char* guid_buf, size_t guid_buf_size) {
    // The function is for bootloader to set the correct UUID
@@ -96,7 +96,7 @@ static AvbIOResult dummy_get_unique_guid_for_partition(AvbOps* ops ATTRIBUTE_UNU
    return AVB_IO_RESULT_OK;
}

static AvbIOResult dummy_get_size_of_partition(AvbOps* ops ATTRIBUTE_UNUSED,
static AvbIOResult no_op_get_size_of_partition(AvbOps* ops ATTRIBUTE_UNUSED,
                                              const char* partition ATTRIBUTE_UNUSED,
                                              uint64_t* out_size_num_byte) {
    // The function is for bootloader to load entire content of AVB HASH partitions.
@@ -123,15 +123,15 @@ FsManagerAvbOps::FsManagerAvbOps() {
    // We only need to provide the implementation of read_from_partition()
    // operation since that's all what is being used by the avb_slot_verify().
    // Other I/O operations are only required in bootloader but not in
    // user-space so we set them as dummy operations. Also zero the entire
    // user-space so we set them as no-op operations. Also zero the entire
    // struct so operations added in the future will be set to NULL.
    memset(&avb_ops_, 0, sizeof(AvbOps));
    avb_ops_.read_from_partition = read_from_partition;
    avb_ops_.read_rollback_index = dummy_read_rollback_index;
    avb_ops_.validate_vbmeta_public_key = dummy_validate_vbmeta_public_key;
    avb_ops_.read_is_device_unlocked = dummy_read_is_device_unlocked;
    avb_ops_.get_unique_guid_for_partition = dummy_get_unique_guid_for_partition;
    avb_ops_.get_size_of_partition = dummy_get_size_of_partition;
    avb_ops_.read_rollback_index = no_op_read_rollback_index;
    avb_ops_.validate_vbmeta_public_key = no_op_validate_vbmeta_public_key;
    avb_ops_.read_is_device_unlocked = no_op_read_is_device_unlocked;
    avb_ops_.get_unique_guid_for_partition = no_op_get_unique_guid_for_partition;
    avb_ops_.get_size_of_partition = no_op_get_size_of_partition;

    // Sets user_data for GetInstanceFromAvbOps() to convert it back to FsManagerAvbOps.
    avb_ops_.user_data = this;
+3 −3
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ AvbUniquePtr AvbHandle::LoadAndVerifyVbmeta(
            return nullptr;
    }

    // Sanity check here because we have to use vbmeta_images_[0] below.
    // Validity check here because we have to use vbmeta_images_[0] below.
    if (avb_handle->vbmeta_images_.size() < 1) {
        LERROR << "LoadAndVerifyVbmetaByPartition failed, no vbmeta loaded";
        return nullptr;
@@ -405,11 +405,11 @@ AvbUniquePtr AvbHandle::Open() {
    //   - AVB_SLOT_VERIFY_RESULT_ERROR_VERIFICATION (UNLOCKED only).
    //     Might occur in either the top-level vbmeta or a chained vbmeta.
    //   - AVB_SLOT_VERIFY_RESULT_ERROR_PUBLIC_KEY_REJECTED (UNLOCKED only).
    //     Could only occur in a chained vbmeta. Because we have *dummy* operations in
    //     Could only occur in a chained vbmeta. Because we have *no-op* operations in
    //     FsManagerAvbOps such that avb_ops->validate_vbmeta_public_key() used to validate
    //     the public key of the top-level vbmeta always pass in userspace here.
    //
    // The following verify result won't happen, because the *dummy* operation
    // The following verify result won't happen, because the *no-op* operation
    // avb_ops->read_rollback_index() always returns the minimum value zero. So rollbacked
    // vbmeta images, which should be caught in the bootloader stage, won't be detected here.
    //   - AVB_SLOT_VERIFY_RESULT_ERROR_ROLLBACK_INDEX
Loading