Security Flashcards
What are exception levels in the ARMv8-A execution model
The levels determine the level of execution privilege, e.g. “user mode” and “privileged mode”
What are trusted execution environments?
Split the architecture into a “normal world” and a “secure world”.
What is the role of “secure world”?
Has its own software
Deals with more sensitive operations (encryption, etc.)
What does the “secure world” in ARMv8-A consist of?
Has 3 exception levels:
EL0: For applications
EL1: For trusted OS
EL3: Secure monitor, this secure monitor manages both the normal- and the secure-world
What does the “normal world” in ARMv8-A consist of?
EL0: Run applications
EL1: OS kernel (Guest OSes), e.g. Linux or Windows runnin in non-secure EL1. When running under a hypervisor, we can switch between the OSes and run the OS kernels either as host or guest.
EL2: Hypervisor, when present and enabled, switches operation between multiple guest OSes
EL3: Low-level firmware (Secure monitor)
What does the Secure monitor in EL3 do?
Deals with the transition from normal- to secure-world
What are the security states?
Normal world: Non-secure state
Secure world: Run specific security features
What is Secure firmware in the secure world?
To ensure a secure system, the secure firmware is the first thing that is booted, and initializing everything, before handing it over to the normal, non-secure world.
It provides services such as platform initialization, installation of Trusted OS and routing of Secure monitor calls
What does the Trusted OS do? (3)
Partitions between different functionalities we want to have within the secure world, that are not supposed to interfene with each other or leak information to each other.
Provides secure services to the normal world.
Provides a runtime environment for executing Secure or trusted applications
What exception level does the trusted OS run at?
EL2
What exception level does secure firmware run at?
Runs at EL3 or EL1
In the secure, and non-secure world, what is the component with the highest privilege?
The Monitor
What does the monitor do in the secure- and non-secure world?
Handles communication and switching between the secure kernels and non-secure kernels
How does a non-secure application communicate with the monitor?
Not directly, through the privileged modes escalation that is the non-secure kernel
app -> kernel -> monitor
Uses fixed entry points to the monitor
How does caches and MMU (memory management unit) separate between the secure- and non-secure world?
Have a security-bit (NS/S)
This separates the hardware resources, such that you cant access secure resources from the non-secure world.
The AXI protocol (from interconnects) has a AxPROT[1] signal that indicates if an access is secure or non-secure. When a message is sent on the interconnect, we have this additional wiring that tells if the message is sent securely or not.
What can happen if secure booting does not happen correctly?
Can get a compromised system if the secure world is not enabled correctly or not at all
Why is the design of a boot sequence important?
It is a fundamental part of creating a secure system.
What are some normal boot actions when initializing a secure OS? (4)
All these actions are done in secure-mode because we have access to all the hardware.
Generating page tables
Switch on the MMU (if design uses caches or memory protection)
Switch on the stack
Set up run time environment and program stacks for each processor mode
What happens when we initialize the secure monitor, during the boot sequence?
The secure monitor is the component with highest privileges.
Allocates scratch workspace
Set up secure monitor stack pointer and initialize its state block
What are the 4 steps in a boot sequence?
1: Initialize secure OS
2: Initialize secure monitor
3: Program the partition checker to allocate physical memory available to the non-secure OS
4: Yield control to the Non-secure OS, the non-secure OS boots after this - i.e. the windows or linux system will start booting
Who is responsible for switching between secure and non-secure world?
The secure monitor
What it the SMC instruction?
Called when we want to switch between worlds.
Requires privileged level.
A user application is required to execute a supervisor call (SVC) instruction and let the supervisor call handler perform the SMC and connect to the secure monitor
What is the secure monitor mode?
Highest privilege level
Is always secure regardless of the state of the NS bit. There is a NS bit in the processor that tells if we are currently in the secure or non-secure mode.
What is the Secure Monitor itself?
Code that runs in Secure Monitor mode (EL3)
It processes the switches between non-secure and secure world
What does the overall security of the software rely on?
The security of the Secure monitor code, along with the secure boot code.
If there is a bug there, we can gain access to everything, because the NS bit does not mean anything here.
What is the secure world used for? (4)
Secure boot
Accessing hardware features
- user applications must go through the secure world to access these
- crypto engine
- credential storage(key store)
- true random number generator)
Digital rights management
Protecting/monitoring the normal world
- real time kernel protection
- periodic kernel measurement (go in and check if any modifications has been done to the kernel code)
What is TrustZone in ARM microcontrollers?
The separation between non-secure and secure state
Non secure: Rich OS (linux)
Secure: Secure app/libs, -OS and -monitor
What is the SAU (security attribution unit) in ARM micro controllers?
Separates the secure and non-secure world
Describe the flow when a request comes from the CPU to the SAU
Request from CPU -> SAU
The SAU either accesses the non-secure MPU or secure MPU (memory protection unit).
Which MPU is accessed depends on the NS bit
What happens if you do a NS access to a secure address?
Memory fault