Skip to content

Commit b412170

Browse files
committed
llext: avoid DRAM access in userspace when freeing
llext_manager_free_module() cannot access DRAM when running with userspace LL enabled. Don't call lib_manager_get_library_manifest() to obtain the DRAM descriptor, needed to verify the entry index. The index is now verified by llext_manager_mod_find(). Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 364864d commit b412170

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

‎src/library_manager/llext_manager.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,16 +1086,9 @@ int llext_manager_rm_domain(const uint32_t component_id, struct k_mem_domain *do
10861086
int llext_manager_free_module(const uint32_t component_id)
10871087
{
10881088
const uint32_t module_id = IPC4_MOD_ID(component_id);
1089-
struct sof_man_fw_desc *desc = (struct sof_man_fw_desc *)lib_manager_get_library_manifest(module_id);
10901089
struct lib_manager_mod_ctx *ctx = lib_manager_get_mod_ctx(module_id);
10911090
uint32_t entry_index = LIB_MANAGER_GET_MODULE_INDEX(module_id);
10921091

1093-
if (entry_index >= desc->header.num_module_entries) {
1094-
tr_err(&lib_manager_tr, "Invalid driver index %u exceeds %d",
1095-
entry_index, desc->header.num_module_entries - 1);
1096-
return -ENOENT;
1097-
}
1098-
10991092
if (!ctx->mod) {
11001093
tr_err(&lib_manager_tr, "NULL module array: ID %#x ctx %p", component_id, ctx);
11011094
return -ENOENT;

0 commit comments

Comments
 (0)