TEE Data Passing Cache to Block Double Fetch Tampering
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data passing mechanisms in Trusted Execution Environments (TEE) are vulnerable to Double Fetch attacks, where malicious applications in the Rich Execution Environment (REE) can tamper with shared memory data between a Client Application (CA) and a Trusted Application (TA), bypassing validation and compromising security.
Innovation Solution
A method and device that utilize a secure operating system to allocate a cache area in the TEE, copy data from shared memory to this cache area, and ensure the Trusted Application (TA) accesses the cached data, thereby preventing tampering and ensuring secure data transfer.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If data is passed through shared memory between CA and TA, then data transfer efficiency is improved, but security is worsened due to Double Fetch attacks
Solution Approach 1:
The secure operating system performs preliminary actions by allocating a cache area in the TEE and copying data from shared memory to this cache area before the TA executes. This preliminary data transfer and validation ensures that the TA reads from a protected, pre-validated location, preventing Double Fetch attacks while maintaining efficient data access during execution.
Solution Approach 2:
The cache area in the TEE acts as an intermediary between the shared memory in REE and the TA execution. The secure operating system mediates the data transfer by copying data to this intermediate cache location, which then serves as the protected source for TA operations. This intermediary layer isolates the TA from direct access to shared memory, eliminating the attack vector.
2Reliability
If a cache area is allocated and data is copied from shared memory to cache area, then security is improved by preventing tampering, but device complexity increases
Solution Approach 1:
The secure operating system automatically manages the cache area allocation, data copying, and address updating processes. The system self-services by handling the complexity of memory management internally, providing a simple interface to applications while maintaining robust security protocols. This automation reduces the perceived complexity for users and applications.
3Reliability
If the secure operating system updates the shared memory address to cache area address, then security is improved, but operation complexity increases
Solution Approach 1:
The secure operating system creates a copy of the data from shared memory to a cache area in the TEE. It then updates the address in the call parameter to point to this cached copy instead of the original shared memory location. This copying mechanism ensures the TA operates on a protected copy while simplifying address management through automatic address updating by the secure OS.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A method for passing data includes: a secure operating system allocating a cache area in trusted execution environment (TEE) to data in response to a client application (CA) calling a trusted application (TA) entry to pass the data to a TA; the secure operating system copying the data from a pre-allocated shared memory to the cache area; and the secure operating system running the TA entry so that the TA obtains the data from the cache area.