diff options
author | Jens Wiklander | 2021-01-04 01:34:53 -0600 |
---|---|---|
committer | Jérôme Forissier | 2021-01-07 08:49:29 -0600 |
commit | 7fb5f45422e6ca95dc63da1a0fe48f752eefcd38 (patch) | |
tree | 1a97f9fdaa9b7b7b6854419ea46063a6c274a694 | |
parent | a499fe129c9103839b25173d69da13a0f5888d8a (diff) | |
download | ti-optee-os-7fb5f45422e6ca95dc63da1a0fe48f752eefcd38.tar.gz ti-optee-os-7fb5f45422e6ca95dc63da1a0fe48f752eefcd38.tar.xz ti-optee-os-7fb5f45422e6ca95dc63da1a0fe48f752eefcd38.zip |
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 02eac0e71..891d2a5e0 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) | |||
610 | panic(); | 610 | panic(); |
611 | } | 611 | } |
612 | 612 | ||
613 | if (core_mmu_remove_mapping(MEM_AREA_EXT_DT, external_dt.blob, | ||
614 | CFG_DTB_MAX_SIZE)) | ||
615 | panic("Failed to remove temporary Device Tree mapping"); | ||
616 | |||
613 | /* External DTB no more reached, reset pointer to invalid */ | 617 | /* External DTB no more reached, reset pointer to invalid */ |
614 | external_dt.blob = NULL; | 618 | external_dt.blob = NULL; |
615 | 619 | ||