dma support for the sancus architecture
play

DMA Support for the Sancus Architecture Lightweight and Open-Source - PowerPoint PPT Presentation

DMA Support for the Sancus Architecture Lightweight and Open-Source Trusted Computing for the IoT Sergio Seminara seminara@kth.se KTH - Kungliga Tekniska Hgskola Examiner: prof. Mads Dam Supervisor: prof. Roberto Guanciale Seminara (KTH)


  1. DMA Support for the Sancus Architecture Lightweight and Open-Source Trusted Computing for the IoT Sergio Seminara � seminara@kth.se KTH - Kungliga Tekniska Högskola Examiner: prof. Mads Dam Supervisor: prof. Roberto Guanciale Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 0 / 27

  2. Introduction Goal of the Thesis Sancus 2.0 DMA Goal of the Thesis To extend Sancus 2.0 architecture with DMA capabilities, without affecting its security guarantees Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 1 / 27

  3. Introduction Goal of the Thesis Contributions of the Thesis: 1 Provide a background on Sancus and PMA in general 2 Show that a direct implementation of DMA breaks security guarantees 3 Propose secure DMA implementations on Sancus that preserve security properties Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 2 / 27

  4. Introduction Goal of the Thesis What is DMA? Direct Memory Access (DMA) It is a feature of CPUs that allows hardware subsystems to directly access the memory, without the participation of the Control Unit (CU). � Without DMA, the CPU would be fully occupied during I/O operations. In this sense, DMA speeds up the system, by unburdening the CPU from I/O loads. Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 3 / 27

  5. Introduction Goal of the Thesis What is Sancus 2.0? Sancus Target architecture of the thesis is Sancus a [5], an open-source, lightweight PMA with a specific focus for networked embedded devices. a Sancus version with secure DMA support is currently maintained on GitHub at https://github.com/S3rg7o/sancus-core Protected Modules Architectures Security architectures running independently from an operating system, that can execute code in an isolated area of the memory. Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 4 / 27

  6. Introduction PMAs and PC Based MAC Secure Code Execution on Embedded Devices Embedded device are required to be cheap in terms of: – Chip area unsuitable to implement established – Chip complexity → solutions from high-end devices world – Power consumption A promising solution is found in Protected (software) Module Architectures , security architectures that offers: – Isolated execution of protected software module – Secure remote attestation – Divide-and-conquer approach, as complex software is splitted into smaller protected modules, easier to verify [4] Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 5 / 27

  7. Introduction PMAs and PC Based MAC Program-Counter Based Memory Access Control PC Based MAC Memory protection technique which sets different memory permissions depending on the current value of the PC. Hardware-only solution, with minimal TCB 1 Strong modules isolation and confidentiality guarantees Low cost → compatible with lightweight embedded devices Memory access rights from \ to Protected Unprotected Entry point Code Data Entry point r - x r - x r w - r w x PC Text section r - x r - x r w - r w x Unprotected \ - - x - - - - - - r w x Other SMs 1 Trusted Computing Base Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 6 / 27

  8. Introduction PMAs and PC Based MAC PC Based Memory PMAs Access Control Memory Protection on Embdedded Devices Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 7 / 27

  9. Introduction Sancus Overview System Model A single infrastructure provider IP owns and administers a set of networked microprocessor-based systems, referred as nodes N i . IP N 1 SP 1 · · · SM 1 , 1 SM 2 , 1 N 2 SP 2 . . · · · SM 2 , 2 SM j , k . . . SP j . Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 8 / 27

  10. Introduction Sancus Overview Security Properties: SMs Isolation Remote Attestation Secure Communication & Secure Linking Secure Key Management Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 9 / 27

  11. Introduction Sancus Overview Attacker Model Attackers can: Manipulate all the software on the node and act as software providers Control the communication network, independently of its security protocol Perform protocol-level attacks on cryptographic functions Plug-in their own peripherals before the system is started. Any further alteration at runtime is not considered in this model Attackers cannot: Have physical access to the hardware of the system. At anytime they cannot: – Access CPU internal registers – Place probes on memory buses – Disconnect components at runtime Break cryptographic primitives Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 10 / 27

  12. Introduction Sancus Overview Software Module on a Sancus Node Processor protect(layout,SP) instruction supervises SMs deployment Node Memory Unprotected Next ID Protected Caller ID storage area K N A software module is composed by: Code section, containing protected code and constants, that can be entered only via few predefined entry points Data section, containing the module private data Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 11 / 27

  13. Introduction Sancus Overview Software Module on a Sancus Node Processor protect(layout,SP) instruction supervises SMs deployment Node SM 1 text section SM 1 data section Entry point Memory Unprotected Code & constants Unprotected Unprotected Protected data Next ID TS 1 TE 1 DS 1 DE 1 K N , SP , SM 1 ID SM 1 SM 1 metadata Protected Caller ID storage area K N TS n TE n DS n DE n K N , SP , SM n ID SM n SM n metadata Layout Key ID � The node key K N , together with all SMs keys K N , SP , SM i , are stored in the Protected Storage Area (PSA). � PSA is not mapped into the system memory � keys never leak on Sancus! Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 11 / 27

  14. Introduction Sancus Overview Trusted Computing Base (TCB) � The set of hardware or software components critical for the security of the system. Sancus TCB is hardware-only TCB RAM or Frontend ROM Memory Backbone SM Control Execution Unit RAM SM1 SM2 MAL MAL Violation Layout Layout Key Key Peripheral Bus Key & Layout Crypto Unit MAB Interface DMA DMA Peripherals Peripherals DMA Controller Address registers FSM Number of words Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 12 / 27

  15. Introduction Sancus Overview DMA Controller Sancus is provided with a default DMA controller. Main benefits from its inclusion in the system are: Multiplex different devices, with a positional priority arbitration Incorporate all the complexity of the DMA protocol in use on Sancus Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 13 / 27

  16. Problem Statement PC Based Memory PMAs Access Control Memory Protection DMA? on Embdedded Devices Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 14 / 27

  17. Problem Statement DMA Support for PMAs PMAs generally do not support DMA PC based MAC is enforced over the CPU memory access bus (MAB). • What if the untrusted element resides outside CPU domain? • What if there was a way to directly access the memory, bypassing any CPU control, so that no violation is raised on illegal accesses? Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 15 / 27

  18. Problem Statement DMA Support for PMAs DMA Exploitation on PMAs � Watch out � An attacker with DMA capabilities can tamper with any location of the system memory at runtime, as DMA bypasses any MMU-like control. An example of DMA exploitation, for the Sancus architecture, is provided at https://github.com/S3rg7o/sancus-examples/blob/master/hello-DMA/Readme.md . Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 16 / 27

  19. Extending DMA on Sancus Sancus 2.0 What about Sancus? It does not support DMA natively Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 17 / 27

  20. Extending DMA on Sancus Direct DMA Implementation Direct DMA Implementation Breaks Sancus security guarantees! Every memory location can be accessed, including the SMs protected sections. Modules isolation reneges The K N , SP , SM key is computed only once, on module deployment. If isolation reneges, it can’t be no longer be considered a sufficient assurance of modules integrity Nodes and modules keys are inaccessible from DMA � SMs isolation is a crucial security property � An attacker can entirely rewrite the text section of a module, making it de facto a Trojan horse � Although alarming, this scenario differs from keys disclosure since attacker’s computational capabilities are still confined to compromised node Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 18 / 27

  21. Extending DMA on Sancus Solution Tree Need for solutions! DMA on PMAs? 1) No DMA in the system Allow DMA in the system 2) Enforce PC-based 3) Exclude DMA from 4) Allow access to specific memory access control protected memory locations in SMs data sections Seminara (KTH) DMA Support for the Sancus Architecture 19 February 2019 19 / 27

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend