Loading fs_mgr/libfiemap/fiemap_writer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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. Loading fs_mgr/libfiemap/split_fiemap_writer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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_ = {}; } Loading fs_mgr/libfiemap/utility.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading fs_mgr/libfs_avb/avb_ops.cpp +18 −18 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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, Loading @@ -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. Loading @@ -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 Loading @@ -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. Loading @@ -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; Loading fs_mgr/libfs_avb/fs_avb.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading
fs_mgr/libfiemap/fiemap_writer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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. Loading
fs_mgr/libfiemap/split_fiemap_writer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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_ = {}; } Loading
fs_mgr/libfiemap/utility.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading
fs_mgr/libfs_avb/avb_ops.cpp +18 −18 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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, Loading @@ -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. Loading @@ -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 Loading @@ -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. Loading @@ -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; Loading
fs_mgr/libfs_avb/fs_avb.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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