Skip to content

Paged TAs mapping issue

Moderate
jbech-linaro published GHSA-5p5v-7hh8-6rfw May 10, 2021

Package

OP-TEE

Affected versions

< 3.13.0

Patched versions

>= 3.13.0

Description

In the 3.x series of OP-TEE, up to 3.12.0 there have been two issues affecting paged Trusted Applications that allow a client of a Trusted Application (TA) to corrupt the TA memory memory when the TA is about to invoke another TA with a private memory reference as invocation parameter.

Only platforms with CFG_WITH_PAGER=y and CFG_PAGED_USER_TA=y are affected.

The first issue relates to how client memory references are unmapped in Trusted Application context. When pager is enabled, mapping information were not cleared from the trusted application MMU tables. This issue affects all 3.x series up to 3.12.0.

The second issue is a flaw introduced in 3.6.0 where a core service helps TAs to isolate the memory it they are about to pass to another TA they invoke. This service makes the TA to request a newly mapped ZI pages (through a syscall to OP-TEE system PTA). The implementation is fine but due to previous issue, paged TAs happen to still map client old memory reference instead of the new ZI maps claims to core. A client could leverage this flaw to invoke a TA right before it is about to claim new ZI pages and have the TA mapping the client memory instead of TA new ZI pages.

The flaw has been addressed in 3.13.0 by fixing initial issue to properly update TA MMU translation tables when client memory reference parameters are unmapped from TA context.

Patches

optee_os.git

  • core: add pgt_clear_ctx_range (74cb1bd)
  • core: add tlbi_mva_range_asid (c1e0a83)
  • core: clear user mappings from tables when removed (a5a72f2)

Workarounds

Disabling the pager might be sufficient in some cases CFG_WITH_PAGER=n and CFG_PAGED_USER_TA=n. But there could be other issues with disabling the pager.

References

N/A

OP-TEE ID

OP-TEE-2021-0001

Reported by

STMicroelectonics

For more information

For more information regarding the security incident process in OP-TEE, please read the information that can be found when going to the "Security" page at https://www.trustedfirmware.org.

Severity

Moderate

CVE ID

No known CVE

Weaknesses

No CWEs