</>EmbeddedInterview

What is TrustZone?

MediumARM Architecture

Short answer: TrustZone provides hardware-backed security state separation. A typical system has a normal world and a secure world, with controlled transitions and protected resources.

Normal worldLinux / AndroidSecure monitorSMCSecure worldTrusted OS
SMC #0 // monitor call, where permitted

1. Normal world: Runs the ordinary OS and applications, with access limited to non-secure resources.

2. Secure world: Runs trusted firmware or a trusted OS and can protect keys or sensitive services through platform security controls.

3. Transition: An SMC may enter the secure monitor (depending on routing/configuration), which validates the request and coordinates world switching. Memory controllers and peripheral firewalls enforce resource separation.

TrustZone Virtualization
Security state separation Guest isolation and resource control
Secure monitor typically EL3 Hypervisor typically EL2

Interview takeaway: TrustZone is hardware-assisted isolation, not automatic security for every application; secure firmware and platform configuration matter.

Example: trusted service from a normal-world application

Normal-world application
    -> kernel TEE driver
    -> SMC / platform call
    -> secure monitor
    -> trusted OS / trusted application
    -> validated result returned to normal world

For example, a normal-world client requests a cryptographic operation using a protected key. The trusted service performs the operation without exposing that key to the caller. Shared-memory arguments must be checked for valid address ranges, size, permissions and lifetime. The normal-world kernel may be untrusted by the secure service's threat model.

TrustZone requires the SoC's memory and peripheral security controllers to enforce the intended resource attribution. The secure monitor, trusted OS, secure boot chain and trusted applications must also be correctly implemented. TrustZone does not itself encrypt all memory or prove the correctness of trusted code. On Cortex-M, TrustZone uses a different exception and gateway model from the Cortex-A SMC/EL3 architecture. Newer Arm systems can provide additional security states and isolation facilities, so consult the implemented architecture.