Incoherent Data and Instruction Caches are the Original DEP
CSAW 2014 Workshop Series
C.R.E.A.M.
Caches Ruin Exploits Around Me
SIGILL?!?
Program received signal SIGILL, Illegal instruction.
0xbeffa890 in ?? ()
(gdb) x/i 0xbeffa890
0xbeffa890: add r6, pc, #1
Looks fine to me (and GDB)...
CPU Instruction Cycle
Where can exceptions occur and result in:
"Comp fetch execute cycle" by Ratbum - Own work. Licensed under Creative Commons Attribution 3.0 via Wikimedia Commons - http://commons.wikimedia.org/wiki/File:Comp_fetch_execute_cycle.png#mediaviewer/File:Comp_fetch_execute_cycle.png
Example: BeagleBone Black
AM335x Technical Reference Manual
Caches, how do they work?�What does all of that actually mean?!?
Memory Hierarchy
http://www.edwardbosworth.com/CPSC2105/Lectures/Slides_06/Chapter_07/Pentium_Architecture_files/image004.gif
Separate vs. Unified/Integrated
Separate caches:
�Unified (“integrated”) caches:
Data/Instruction Cache Incoherency
16-Word Lines
SIGILL?!?
Program received signal SIGILL, Illegal instruction.
0xbeffa890 in ?? ()
(gdb) x/i 0xbeffa890
0xbeffa890: add r6, pc, #1
Looks fine to me (and GDB)...
Code Injection and Separate Caches
Code Injection and Separate Caches
http://www.edwardbosworth.com/CPSC2105/Lectures/Slides_06/Chapter_07/Pentium_Architecture_files/image004.gif
Payload
Code Injection and Separate Caches
http://www.edwardbosworth.com/CPSC2105/Lectures/Slides_06/Chapter_07/Pentium_Architecture_files/image004.gif
Payload
Code Injection and Separate Caches
http://www.edwardbosworth.com/CPSC2105/Lectures/Slides_06/Chapter_07/Pentium_Architecture_files/image004.gif
Payload
Flushing the Data Cache
Summary
Where will you run into this?
Reliable exploitation requires deep understanding of how your target works