Control Flow Integrity

Created
Created
2024 May 24 5:42
Editor
Creator
Creator
Seonglae ChoSeonglae Cho
Edited
Edited
2024 Jun 14 8:21
Refs

CFI

Control flow return integrity

Preventing corruption of return addresses by separating stack into two
  • Safe stack
    • Return address
    • Non-array local variables
  • Unsafe Stack
    • Arrays that can be indexed

Indirect function call checking
LLVM
Clang

-fsanitize=cfi-icall
 

Intel TigerLake and onwards

Safe Stack

Detecting corruption of return addresses

  • Store a copy of the return address at call.
  • Check the actual return address matches the copy at return.
  • This can be supported in hardware.
 

Shadow stack

Detecting corruption of return addresses on Intel CPU
a shadow stack is a mechanism for protecting a procedure's stored return address
 
 

ASLR

Address Space Layout Randomization is a probability based effect approach
The executable must be
PIE
(Position Independent Executable) in randomized
BypassingASLR via Position-Independent ROP
 
 
 
 
 
 

Recommendations