Acaces2019 Proc Arch Sec Part-1
Acaces2019 Proc Arch Sec Part-1
Jakub Szefer
Assistant Professor
Dept. of Electrical Engineering
Yale University
E.g. predict control flow direction or data values before they are actually
• Predicting computed allows code to execute speculatively.
• Parallelizing E.g. processing multiple data in parallel allows for more computation to be
done concurrently.
• Use of indirection E.g. virtual to physical mapping abstracts away physical details of the system.
• Specialization E.g. custom instructions use dedicated circuits to implement operations that
otherwise would be slower using regular processor instructions.
Secure Processor Architectures extend a processor with hardware (and related software) features
for protection of software
• Protected pieces of code and data are now commonly called Enclaves
• But can be also Trusted Software Modules, whole Operating Systems, or Virtual Machines
• Focus on the main processor in the system
• Others focus on co-processors, cryptographic accelerators, or security monitors
• Add more features to isolate secure software from other, untrusted software
• Includes untrusted Operating System or Virtual Machines
• Many also consider physical attacks on memory
• Isolation should cover all types of possible ways for information leaks
• Architectural state
Most recent threats, i.e. Spectre, etc.
• Micro-architectural state
• Due to spatial or temporal Side and covert channel threats
sharing of hardware
Starting with a typical baseline processor, many secure architectures have been proposed
Starting in late 1990s or early 2000s, academics have shown increased interest in secure processor
architectures:
XOM (2000), AEGIS (2003), Secret-Protecting (2005), Bastion (2010),
NoHype (2010), HyperWall (2012), Phantom (2013), CHERI (2014), Sanctum (2016),
Keystone (about 2017), Ascend (2017), MI6 (2018)
LPAR in IBM mainframes (1970s), Security Processor Vault in Cell Broadband Engine (2000s),
ARM TrustZone (2000s), Intel TXT & TPM module (2000s), Intel SGX (mid 2010s),
AMD SEV (late 2010s)
Processor Chip
Information can be extracted
Core Core from memory or memory
… contents can be modified.
$ $ $ $
Compromised or malicious
Memory devices can attack other
I/O Devices
components of the system.
Typical computer system uses ring-based protection scheme, which gives most privileges
(and most trust) to the lowest levels of the system software:
Hardware
Image:
https://commons.wikimedia.org/wiki/File:Priv_rings.svg
ACACES Course on Processor Architecture Security
© Jakub Szefer 2019 8
Logical Isolation with New Privilege Levels
Modern computer systems define protections in terms of privilege level or protection rings,
new privilege levels are defined to provide added protections.
Normal Privileged
• E.g. ARM’s TrustZone’s “normal” and “secure” worlds Operation Operation
Ring -1
Ring 0
Normal
Privileged
Ring 0
Normal Ring 3
Privileged
Ring 3
Normal Image:
https://commons.wikimedia.org/wiki/File:Priv_rings.svg
ACACES Course on Processor Architecture Security
© Jakub Szefer 2019 11
Breaking Linear Hierarchy of Protection Rings
App
App App
App App
App App
App
Encl
Ring 3 App Ring 3 App
TSM
Ring 3 App
ave Ring 3 App
Key to most secure processor architecture designs is the idea of trusted processor chip as the
security wherein the protections are provided.
Processor Chip
Core Core Whole processor chip is
… trusted.
$ $ $ $
$ Memory is untrusted.
Uncore
System bus is untrusted.
The Trusted Computing Base (TCB) is the set of hardware and software that is responsible
for realizing the TEE:
• TEE is created by a set of all the components in the TCB
• TCB is trusted to correctly implement the protections
• Vulnerability or successful attack on TCB nullifies TEE protections
• TCB is trusted
• TCB may not be trustworthy, if is not verified or is not bug free
Different architectures mainly focus on protecting Trusted Software Modules (a.k.a. enclaves)
or whole Virtual Machines.
Hardware
Security properties for the TEEs that secure processor architectures aim to provide:
Confidentiality and integrity protections are from attacks by other components (and hardware) not in
the TCB. There is typically no protection from malicious TCB.
Secure processor architectures break the linear relationship (where lower level
protection ring is more trusted):
SecE
SMM and SecE are always
trusted today, no
architecture explores
design where these levels
are untrusted. ACACES Course on Processor Architecture Security
© Jakub Szefer 2019 18
Protecting State of the Protected Software
Protected software’s state is distributed throughout the processor. All of it needs to be protected
from the untrusted components and other (untrusted) protected software.
Secure processor architectures ideally have no side-effects which are visible to the untrusted
components whenever protected software is executing.
The software (code and data) executing within TEE protections is assumed to be benign
and not malicious:
• Goal of Secure Processor Architectures is to create minimal TCB that realizes a TEE
within which the protected software resides and executes
• Secure Processor Architectures can not protect software if it is buggy or has vulnerabilities
Trustworthiness of the TCB depends on the ability to monitor the TCB code
(hardware and software) execution as the system runs.
KR
Memory I/O Devices
Km KSK KPK …
KR Cache
• Use Physically Uncloneable Functions
(but requires reliability) SecE Uncore
• Extra hardware to derive keys from PUF
• Mechanisms to generate and distribute
certificates for the key
Memory I/O Devices
Derived form the root of trust are signing and verification keys.
Emoji Image:
• Need infrastructure! https://www.emojione.com/emoji/1f3ed
https://www.emojione.com/emoji/1f469-1f4bc
ACACES Course on Processor Architecture Security
© Jakub Szefer 2019
https://www.emojione.com/emoji/1f3e2 26
Software Measurement
With an embedded signing key, the software running in the TEE can be “measured” to attest to
external users what code is running on the system.
Emoji Image:
https://www.emojione.com/emoji/1f469-1f4bc
ACACES Course on Processor Architecture Security
© Jakub Szefer 2019 27
Using Software Measurement
• Constantly measure the system, e.g. performance counters, and look for anomalies
• Requires knowing correct and expected behavior of system
• Can be used for continuous authentication
Attacker can “hide in the noise” if they change the execution of the software slightly and do not affect
performance counters significantly.
Contents of the memory can be protected with encryption. Data going out of the CPU is encrypted,
data coming from memory is decrypted before being used by CPU.
a) Encryption engine (usually AES in CTR mode) encrypts data going out of processor chip
b) Decryption engine decrypts incoming data Pre-compute encryption pads, then only
need to do XOR; speed depends on how
well counters are fetched / predicted.
Hash tree (also called Merkle Tree) is a logical three structure, typically a binary tree, where two
child nodes are hashed together to create parent node; the root node is a hash that depends on
value of all the leaf nodes.
Message Authentication Codes (MACs) can be used instead of hashes, and a smaller
“Bonsai” tree can be constructed.
• For encryption, type of encryption does not typically depend on memory configuration
• For integrity, the integrity tree needs to consider:
• Protect whole memory E.g., Bastion’s memory integrity tree
• Protect parts of memory (e.g. per application, per VM, etc.) (Champagne, et al., HPCA ‘10)
• Protect external storage (e.g. data swapped to disk)
Access patterns (traffic analysis) attacks can be protected with use Oblivious RAM, such as Path
ORAM. This is on top of encryption and integrity checking.
With 2.5D and 3D integration, the memory is brought into the same package as the main processor
chip. Further, with embedded DRAM (eDRAM) the memory is on the same chip.
• Potentially probing attacks are more difficult
• Still limited memory (eDRAM around 128MB in 2017)
• Non-volatile memories (NVMs) can store data even when there is no power
• Non-volatile random-access memory (NVRAM) is a specific type of NVM that is suitable to serve
as a computer system’s main memory, and replace or augment DRAM
Security considerations
• Data remanence makes passive attacks easier (e.g. data extraction)
• Data is maintained after reboot or crash (security state also needs to be correctly restored after
reboot or crash)
Persistence:
• Data persists across reboots and crashes, possibly with errors Persistence
domain
• Need atomicity for data larger than one memory word example
(either all data or no data is “persisted”)
• E.g. Write Pending Queue (WPQ) – memory controller
has non-volatile storage or enough stored charge to write
pending data back to the NV-DIMM or NVRAM
Granularity of persistence:
• Hide non-volatility from the system: simply use memory as DRAM replacement
• Expose non-volatility to the system: allow users to select which data is non-volatile
• Linux support through Direct Access (DAX) since about 2014
• Developed for NV-DIMMs (e.g., battery backed DRAM, but works for NVRAMs)
Image:
https://www.usenix.org/system/files/login/articles/login_summer17_07_rudoff.pdf
ACACES Course on Processor Architecture Security
© Jakub Szefer 2019 42
Integrity Protection of NVRAMs
Off-chip memory is untrusted and the contents is assumed to be protected from the snooping,
spoofing, splicing, replay, and disturbance attacks:
Symmetric Multi Processing (SMP) and Distributed Share Memory (DSM) also referred to as
Non-Uniform Memory Access (NUMA) offer two ways of connecting many CPUs together.
Trusted processor chip boundary is reduced in most research focusing on many-core security
Processor Chip
The processor core is still
trusted
Probing of internal
interconnect still
assumed out-of- Memory I/O Devices
scope. Emoji Image:
https://www.emojione.com/emoji/1f479
ACACES Course on Processor Architecture Security
© Jakub Szefer 2019 49
Architecture and Hardware Security Intersection
With many-core chips, the threats architects worry about start to overlap
with hardware security researchers’ work
• Confidentiality
• Integrity
• Communication pattern protection
Emoji Image:
https://www.emojione.com/emoji/1f479
ACACES Course on Processor Architecture Security
© Jakub Szefer 2019 51
Performance Challenges
Four principles for secure processor architecture design based on existing designs and also on
ideas about what ideal design should look like are: • Architectural state
• Micro-architectural state
• Due to spatial or temporal
1. Protect Off-chip Communication and Memory sharing of hardware
Off-chip components and communication are untrusted, need protection with encryption, hashing,
access pattern protection.
When switching among protected software and other software or other protected software, need to
flush the state, or save and restore it, to prevent one software influencing another.
Need to ensure correct execution of TCB, through open access to TCB design, monitoring,
fingerprinting, and authentication.
Processor Chip
Open research challenges: Core Core
…
• ISA interface to introspect TCB $ $ $ Reg. FU State
• Area, energy, performance costs Cache
due extra features for introspection
SecE Uncore
• Leaking information about
TCB or TEE
Monitoring of software running inside TEE, e.g. TSMs or Enclaves, gives assurances about the state
of the protected software.
Likewise monitoring TCB ensures protections are still in place.
App
App
App
TSM
Open research challenges:
• Interface design for monitoring Guest
OS
E.g. continuous monitoring
• Leaking information about TEE
of a TEE can help prevent
HV
TOC-TOU attacks.
SMM
SecE
Hardware
• …
Verific Perfor
ation mance
Side
TOC-
Chann
els Fast TOU
Crypto
&
State Hash Attack
Flushi Recov
ng Data ery ISA
Reman Interfa
ence ce
Usabili
ty
TCB
Cost
Key
Distrib
ution
Related reading…
https://caslab.csl.yale.edu/books/