diff --git a/tools/rimage/src/adsp_config.c b/tools/rimage/src/adsp_config.c index 6cc7434e74bc..931c77e10403 100644 --- a/tools/rimage/src/adsp_config.c +++ b/tools/rimage/src/adsp_config.c @@ -2052,7 +2052,7 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct image *image) /* assign correct write functions */ out->write_firmware = man_write_fw_v1_5_sue; - out->write_firmware_meu = man_write_fw_meu_v1_5; + out->write_firmware_meu = NULL; out->verify_firmware = ri_manifest_verify_v1_5; /* parse others sibtables */ @@ -2235,7 +2235,7 @@ static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct image *im /* assign correct write functions */ out->write_firmware = man_write_fw_ace_v1_5; - out->write_firmware_meu = man_write_fw_meu_v2_5; + out->write_firmware_meu = NULL; out->verify_firmware = ri_manifest_verify_v2_5; /* version array has already been parsed, so increment ctx.array_cnt */ diff --git a/tools/rimage/src/manifest.c b/tools/rimage/src/manifest.c index 22eddfa00c74..db89d5f699b0 100644 --- a/tools/rimage/src/manifest.c +++ b/tools/rimage/src/manifest.c @@ -542,6 +542,11 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * struct elf_section section; int err; + if (!modules) { + fprintf(stderr, "error: relocatable image requires module configuration\n"); + return -EINVAL; + } + /* load in module manifest data */ err = elf_section_read_by_name(&module->file.elf, ".module", §ion); if (err) { @@ -1786,8 +1791,12 @@ int resign_image(struct image *image) } } - if (i >= size) { - fprintf(stderr, "error: didn't found header marker %d\n", i); + /* the scan stops a full marker before the end, so a trailing partial word + * leaves the loop index below the size; test the result of the scan itself + */ + if (!image->fw_image) { + fprintf(stderr, "error: could not find valid CSE header $CPD in %s\n", + image->in_file); ret = -EINVAL; goto out; } diff --git a/tools/rimage/src/rimage.c b/tools/rimage/src/rimage.c index 2245288dfece..0b41905944c2 100644 --- a/tools/rimage/src/rimage.c +++ b/tools/rimage/src/rimage.c @@ -202,6 +202,12 @@ int main(int argc, char *argv[]) goto out; } + if (image.meu_offset && !image.adsp->write_firmware_meu) { + fprintf(stderr, "error: MEU signing is not supported for this target\n"); + ret = -EINVAL; + goto out; + } + /* set IMR Type and the PV bit in found machine definition */ if (image.adsp->man_v1_8) { if (imr_type_override) @@ -274,7 +280,6 @@ int main(int argc, char *argv[]) /* process and write output */ if (image.meu_offset) { - assert(image.adsp->write_firmware_meu); ret = image.adsp->write_firmware_meu(&image); } else { assert(image.adsp->write_firmware);