/* profile= */ UINT_MAX,
/* validate_base= */ 0,
&vector);
- if (vector.size != sizeof(SD_MAGIC))
+ if (vector.memory_size != sizeof(SD_MAGIC))
return false;
- err = file_handle_read(handle, vector.file_offset, vector.size, &content, &read);
- if (err != EFI_SUCCESS || vector.size != read)
+ err = file_handle_read(handle, vector.file_offset, vector.memory_size, &content, &read);
+ if (err != EFI_SUCCESS || vector.memory_size != read)
return false;
return memcmp(content, SD_MAGIC, sizeof(SD_MAGIC)) == 0;
err = file_handle_read(
handle,
sections[SECTION_OSREL].file_offset,
- sections[SECTION_OSREL].size,
+ sections[SECTION_OSREL].memory_size,
&content,
/* ret_size= */ NULL);
if (err != EFI_SUCCESS)
err = file_handle_read(
handle,
sections[SECTION_PROFILE].file_offset,
- sections[SECTION_PROFILE].size,
+ sections[SECTION_PROFILE].memory_size,
&content,
/* ret_size= */ NULL);
if (err != EFI_SUCCESS)
err = file_handle_read(
handle,
sections[SECTION_CMDLINE].file_offset,
- sections[SECTION_CMDLINE].size,
+ sections[SECTION_CMDLINE].memory_size,
&content,
&cmdline_len);
if (err == EFI_SUCCESS) {
if (!PE_SECTION_VECTOR_IS_SET(section))
return NULL;
- return xstrn8_to_16((const char *) loaded_image->ImageBase + section->memory_offset, section->size);
+ return xstrn8_to_16((const char *) loaded_image->ImageBase + section->memory_offset, section->memory_size);
}
static char *pe_section_to_str8(
if (!PE_SECTION_VECTOR_IS_SET(section))
return NULL;
- return xstrndup8((const char *)loaded_image->ImageBase + section->memory_offset, section->size);
+ return xstrndup8((const char *)loaded_image->ImageBase + section->memory_offset, section->memory_size);
}
static void combine_measured_flag(int *value, int measured) {
if (uname && PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_UNAME) &&
!strneq8(uname,
(const char *)loaded_addon->ImageBase + sections[UNIFIED_SECTION_UNAME].memory_offset,
- sections[UNIFIED_SECTION_UNAME].size)) {
+ sections[UNIFIED_SECTION_UNAME].memory_size)) {
log_error(".uname mismatch between %ls and UKI, ignoring", items[i]);
continue;
}
(*devicetree_addons)[(*n_devicetree_addons)++] = (NamedAddon) {
.blob = {
- .iov_base = xmemdup((const uint8_t*) loaded_addon->ImageBase + sections[UNIFIED_SECTION_DTB].memory_offset, sections[UNIFIED_SECTION_DTB].size),
- .iov_len = sections[UNIFIED_SECTION_DTB].size,
+ .iov_base = xmemdup((const uint8_t*) loaded_addon->ImageBase + sections[UNIFIED_SECTION_DTB].memory_offset, sections[UNIFIED_SECTION_DTB].memory_size),
+ .iov_len = sections[UNIFIED_SECTION_DTB].memory_size,
},
.filename = xstrdup16(items[i]),
};
(*n_initrd_addons + 1) * sizeof(NamedAddon));
(*initrd_addons)[(*n_initrd_addons)++] = (NamedAddon) {
.blob = {
- .iov_base = xmemdup((const uint8_t*) loaded_addon->ImageBase + sections[UNIFIED_SECTION_INITRD].memory_offset, sections[UNIFIED_SECTION_INITRD].size),
- .iov_len = sections[UNIFIED_SECTION_INITRD].size,
+ .iov_base = xmemdup((const uint8_t*) loaded_addon->ImageBase + sections[UNIFIED_SECTION_INITRD].memory_offset, sections[UNIFIED_SECTION_INITRD].memory_size),
+ .iov_len = sections[UNIFIED_SECTION_INITRD].memory_size,
},
.filename = xstrdup16(items[i]),
};
(*n_ucode_addons + 1) * sizeof(NamedAddon));
(*ucode_addons)[(*n_ucode_addons)++] = (NamedAddon) {
.blob = {
- .iov_base = xmemdup((const uint8_t*) loaded_addon->ImageBase + sections[UNIFIED_SECTION_UCODE].memory_offset, sections[UNIFIED_SECTION_UCODE].size),
- .iov_len = sections[UNIFIED_SECTION_UCODE].size,
+ .iov_base = xmemdup((const uint8_t*) loaded_addon->ImageBase + sections[UNIFIED_SECTION_UCODE].memory_offset, sections[UNIFIED_SECTION_UCODE].memory_size),
+ .iov_len = sections[UNIFIED_SECTION_UCODE].memory_size,
},
.filename = xstrdup16(items[i]),
};
(void) tpm_log_ipl_event_ascii(
TPM2_PCR_KERNEL_BOOT,
POINTER_TO_PHYSICAL_ADDRESS(loaded_image->ImageBase) + sections[section].memory_offset,
- sections[section].size,
+ sections[section].memory_size,
unified_sections[section],
&m);
combine_measured_flag(sections_measured, m);
(void) pack_cpio_literal(
(const uint8_t*) loaded_image->ImageBase + sections[t->section].memory_offset,
- sections[t->section].size,
+ sections[t->section].memory_size,
".extra",
t->filename,
/* dir_mode= */ 0555,
if (PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_INITRD))
initrds[INITRD_BASE] = IOVEC_MAKE(
(const uint8_t*) loaded_image->ImageBase + sections[UNIFIED_SECTION_INITRD].memory_offset,
- sections[UNIFIED_SECTION_INITRD].size);
+ sections[UNIFIED_SECTION_INITRD].memory_size);
if (PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_UCODE))
initrds[INITRD_UCODE] = IOVEC_MAKE(
(const uint8_t*) loaded_image->ImageBase + sections[UNIFIED_SECTION_UCODE].memory_offset,
- sections[UNIFIED_SECTION_UCODE].size);
+ sections[UNIFIED_SECTION_UCODE].memory_size);
}
static void export_pcr_variables(
err = devicetree_install_from_memory(
dt_state,
(const uint8_t*) loaded_image->ImageBase + sections[UNIFIED_SECTION_DTB].memory_offset,
- sections[UNIFIED_SECTION_DTB].size);
+ sections[UNIFIED_SECTION_DTB].memory_size);
if (err != EFI_SUCCESS)
log_error_status(err, "Error loading embedded devicetree, ignoring: %m");
}
if (!PE_SECTION_VECTOR_IS_SET(sections + UNIFIED_SECTION_SPLASH))
return;
- graphics_splash((const uint8_t*) loaded_image->ImageBase + sections[UNIFIED_SECTION_SPLASH].memory_offset, sections[UNIFIED_SECTION_SPLASH].size);
+ graphics_splash((const uint8_t*) loaded_image->ImageBase + sections[UNIFIED_SECTION_SPLASH].memory_offset, sections[UNIFIED_SECTION_SPLASH].memory_size);
}
static EFI_STATUS find_sections(
struct iovec kernel = IOVEC_MAKE(
(const uint8_t*) loaded_image->ImageBase + sections[UNIFIED_SECTION_LINUX].memory_offset,
- sections[UNIFIED_SECTION_LINUX].size);
+ sections[UNIFIED_SECTION_LINUX].memory_size);
err = linux_exec(image, cmdline, &kernel, &final_initrd);
graphics_mode(false);