Security Analysis of Processor Instruction Set Architecture for Enforcing Control-Flow Integrity

Security Analysis of Processor Instruction Set Architecture for Enforcing Control-Flow Integrity

Security Analysis of Processor Instruction Set Architecture for Enforcing Control-Flow Integrity Vedvyas Shanbhogue Deepak Gupta Ravi Sahita Intel Corporation Intel Corporation Intel Corporation Austin, TX, USA Hillsboro, OR, USA Hillsboro, OR, USA [email protected] [email protected] [email protected] ABSTRACT 1. INTRODUCTION Intel has developed Control-flow Enforcement Technology (CET) Introduction of security features like No-Execute [1] to prevent [27] that provides CPU instruction set architecture (ISA) data execution (DEP), supervisory mode execute prevention capabilities to defend against Return-oriented Programming (ROP) (SMEP) [1], supervisory mode access prevention (SMAP) [1], etc. and call/jmp-oriented programming (COP/JOP) style control-flow have pushed the state of art of exploitation of software to code- subversion attacks. This attack methodology uses code sequences reuse attacks based exploitation techniques like Return-Oriented in authorized modules with at least one instruction in the sequence Programming (ROP) [2], Jump-Oriented Programming (JOP) [3] being a control transfer instruction that depends on attacker- and Call-oriented programming (COP) [4]. Defending against controlled data either in the return stack or in a register/memory such exploits requires prevention of malicious attempts to invoke for the target address. Attackers stitch these sequences together by control flows that are not part of the program’s control-flow graph. diverting the control flow instruction (e.g. RET, CALL, JMP) from Control- flow Integrity (CFI) [3, 16] proposed that a program its original target address to a new target (via modification in the should only execute control flows that are programmed in by the data stack or in the register or memory used by these instructions). programmer. Specifically, CFI requires that an indirect branch This paper describes CET security objectives, threat model and should only target instructions in the program that have been various architectural design choices to ensure that the design meets designated as targets of indirect branches. Consequently, a forward the security objectives. We conclude the paper with performance branch through an indirect call or jump should only transfer control data and related work in this domain. to valid targets for calls and jumps in the program and a return CCS CONCEPTS instruction should only transfer control to the call site that initiated the call to the procedure being returned from. • Security and privacy → Security in hardware → Hardware Intel Control-flow Enforcement Technology (CET) is a CPU security implementation; • Security and privacy → instruction set extension to implement CFI and defend against Intrusion/anomaly detection and malware mitigation. ROP/JOP style control-flow subversion attacks. It adds the following capabilities to the Intel instruction set architecture: KEYWORDS Control-flow integrity, control flow subversion attacks, shadow • Shadow Stack – return address protection to prevent Return stack, ROP, JOP, COP. Oriented Programming • Indirect branch tracking – free branch protection to enforce ACM Reference format: security properties on Jump/Call Oriented Programming. Vedvyas Shanbhogue, Deepak Gupta and Ravi Sahita. 2019. Security analysis of processor instruction set architecture for enforcing control-flow CET shadow stack is a second stack used exclusively during th integrity. In Proceedings of the 8 International workshop on Hardware control transfer operations to store a copy of the return address and Architectural Support for Security and Privacy (HASP’ 19), June 23, pointer. The shadow stack is write protected using a new extension 2019, Phoenix, AZ, USA. ACM, New York, NY, USA, 11 pages. https://doi.org/10.1145/3337167.3337175 to page permissions to prevent software-originated unintended writes to the shadow stack. The CALL instruction pushes a copy of the return address on the shadow stack in addition to the legacy Permission to make digital or hard copies of part or all of this work for personal or behavior of pushing the return address on the data stack. The RET classroom use is granted without fee provided that copies are not made or instruction is modified to pop the return address from both stacks distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this and if the two return addresses do not match, causes an exception work must be honored. For all other uses, contact the owner/author(s). and thus prevents and reports attempts to modify the return address HASP’19, June 23, 2019, Phoenix, AZ, USA © 2019 Copyright held by the owner/author(s). Publication rights licensed to maliciously (or in error). ACM. CET Indirect branch tracking introduces a new instruction 978-1-4503-7226-8/19/06...$15.00 ENDBRANCH that is used to mark valid code targets for indirect https://doi.org/10.1145/3337167.3337175 HASP’19, June, 2019, Phoenix, Arizona USA Vedvyas Shanbhogue et al. call and jumps in the program. If an indirect call or jump targets an • D7: Provide only the necessary (minimal) capabilities for instruction other than ENDBRANCH, the processor generates an software to be able to impose instruction alignment and return exception and thus prevents and reports attempts to redirect control address protection for language and usage-specific policies. flow to unintended code targets in the program. The approach • D8: Preserve the stack and function call ABI taken here is a coarse-grained forward branch enforcement that can • D9: Must not place any restrictions on common software be further restricted using software instrumentation and compiler constructs like tail calls, co-routines, etc. techniques. CET introduces a new fault-type exception – control protection In section 2, we describe the security model of the shadow stack (#CP) – to notify privileged software when control flow violations capability and the new instructions introduced to manage the are detected. The #CP exception also reports an error code to shadow stack. In section 3, we describe the security model of the notify the reason to the exception handler. indirect branch tracking capability. In section 4, we discuss the speculation-safe hardening properties of CET. In later sections, we 1.1. Adversary model and CET objectives present the performance evaluation, security metrics, and discuss We enumerate the following threats (written as adversary related work, with conclusions. capabilities) to define the scope of mitigations we aim to provide with CET: 2. CET SHADOW STACK A shadow stack is a second stack used exclusively for control • T1: Can find software vulnerabilities that allows the adversary transfer operations to store and to retrieve the return address to read and write anywhere in software-accessible memory. pointers. The shadow stack is distinct from the ordinary data stack, • T2: Can discover the complete layout of the address space and holds no data. (e.g. where stacks, heaps, and images are mapped). • T3: Can repeat memory reads and writes at will. 2.1. SSP register encoding and type safety • T4: Can produce stimulus that make code take different paths CET defines a shadow stack pointer (SSP) register that contains the and observe the state of the program including the stack state linear address of the top of the current shadow stack. Since SSP is in these paths. a new architectural register and must be protected (per design goal • T5: Can send data to a “computation server” to compute D1) against an adversary that can use code re-use capability (per payload needed for subsequent reads/writes. threat T6) to change it. Thus opcode encoding does not allow SSP • T6: Can perform control transfers to existing code to execute register to be directly encoded as a source, destination or memory (code re-use) in order to change state of processor registers. operand in instructions other than shadow stack management instructions. This reduces potential useful code re-use gadgets in Following assumptions were made about constraints on the program memory and helps mitigate techniques like stack pivoting adversary: used to subvert control flow. CET enforces type safety by enforcing that values that are • R1: Cannot add new code without verification and all existing generated as part of CET instructions or implicit ISA flows (e.g. code is read-only and not modifiable (e.g. W ⊕ X policy). privilege transitions) are consumed only by complementary CET instructions or complimentary ISA flows. Examples of such While defining the technology, we enumerate following design enforcement are cited in section 2.3, 2.4, 2.7 and 2.8. goals and constraints: 2.2. Shadow stack for each privilege and exception • D1: Must provide protection mechanism for new architectural delivery assets (i.e. new hardware register, memory) against code re- One of the design goals of CET has been to provide support for use and memory safety errors. control flow enforcement at each privilege level of processor (D2, • D2: Must be applicable to CPU-enforced privilege levels D and D ). The x86 segmentation protection mechanism supports (user/supervisor) 3 4 four privilege levels, numbered from 0 to 3. The greater numbers • D3: Must be applicable to CPU modes used by commodity mean lesser privileges. Most operating systems running on x86 software, such as 32/64-bit, hypervisor, system management architecture only use two privilege levels where the operating mode, enclaves,

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us