BaselineWatch
Desk

4.1 Return Oriented Programming (ROP) and Call/Jump Oriented Programming

NIST platform security: roots of trust, firmware and secure enclaves IR 8320
All changes in this version
first version loaded 4 Software Runtime Protection Mechanisms part of 4

Title

Return Oriented Programming (ROP) and Call/Jump Oriented Programming

Control

(COP/JOP) Attacks

ROP attacks focus on utilizing buffer overflows and targeted memory overwrites of return addresses in the stack. Attackers redirect return flows by corrupting addresses on the data stack to be locations in already-executable code. These small selected sequences of code called gadgets result in malicious modifications to the system or the invocation of normally unauthorized operations. A common example is a call to the shell executable within the system interface [11] .

COP/JOP attacks are similar to ROP attacks, relying on gadget building blocks. They target indirect jump instructions at the end of a gadget, many of which are intentionally emitted by the compiler. However, a jump gadget performs a one-directional control flow transfer to its target, as opposed to ROP, where gadgets return control back to the stack. This can make it difficult for attackers to regain control after executing their gadgets, but solutions to this problem, such as the one presented in [11] , are beginning to appear.

Applications can utilize a parallel stack, known as the shadow stack , to help mitigate software attacks that attempt to modify the control flow. Utilizing special hardware, the shadow stack is used to store a copy of return addresses; the address is checked against the normal program stack on return operations. If the content differs, an exception is generated, which can help prevent malicious code from gaining control of the system with techniques such as ROP. In this way, shadow stack hardware can help mitigate some of the most common and exploitable types of software bugs. Several defenses and preventative measures have been developed within industry to accommodate ROP and COP/JOP attacks, including:

• Intel Control-Flow Enforcement Technology (Intel CET)

• Arm Pointer Authentication Code (PAC)

• Arm Branch Target Identification (BTI)

• IBM ROP and COP/JOP Attack Defenses