diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2021-01-04 08:34:53 +0100 |
---|---|---|
committer | Jérôme Forissier <jerome@forissier.org> | 2021-01-07 15:49:29 +0100 |
commit | 7fb5f45422e6ca95dc63da1a0fe48f752eefcd38 (patch) | |
tree | 1a97f9fdaa9b7b7b6854419ea46063a6c274a694 | |
parent | a499fe129c9103839b25173d69da13a0f5888d8a (diff) |
core: remove temporary external DT mapping
During boot the external DT is mapped while processing the DT. Once
OP-TEE is done with the DT it should be unmapped to avoid stale mappings
that might cause problems later. Fix this by calling
core_mmu_rem_mapping() from release_external_dt() just before jumping to
normal world.
Fixes: https://github.com/OP-TEE/optee_os/issues/4278
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r-- | core/arch/arm/kernel/boot.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/arch/arm/kernel/boot.c b/core/arch/arm/kernel/boot.c index 02eac0e7..891d2a5e 100644 --- a/core/arch/arm/kernel/boot.c +++ b/core/arch/arm/kernel/boot.c @@ -610,6 +610,10 @@ static TEE_Result release_external_dt(void) panic(); } + if (core_mmu_remove_mapping(MEM_AREA_EXT_DT, external_dt.blob, + CFG_DTB_MAX_SIZE)) + panic("Failed to remove temporary Device Tree mapping"); + /* External DTB no more reached, reset pointer to invalid */ external_dt.blob = NULL; |