340 likes | 358 Views
Reviving Instruction Set Randomization. Kanad Sinha * , Vasileios Kemerlis ɫ , Simha Sethumadhavan * * Columbia University ɫ Brown University. Traditional Instruction Set Randomization Provides illusion of a secret instruction set Counters code injection attacks
E N D
Reviving Instruction Set Randomization Kanad Sinha*, VasileiosKemerlisɫ, SimhaSethumadhavan* *Columbia University ɫBrown University
Traditional Instruction Set Randomization • Provides illusion of a secret instruction set • Counters code injection attacks • Considered outdated because of code reuse attacks Contributions: Polyglot Novel hardware ISR scheme • Effective against state-of-the art code reuse attacks • Strengthens code injection countermeasures • Highly performant (old s/w overhead ~70%, new overhead trivial) • Full system FPGA prototype protecting bootup to OS to apps
Code Injection Program Code
Code Injection Program Code Exploit Code
Code Injection countered with ISR Program Code Decryption Engine Drawback #1: No code page sharing
Code Injection countered with ISR Program Code Decryption Engine Drawback #2: Slow
Code Injection countered with ISR Program Code Decryption Engine Drawback #3: Weak encryption
Code Injection countered with ISR Program Code Decryption Engine Exploit Code
ISR is susceptible to code reuse attacks mov %g0, %o0 jmp 0xdeadf00d add %g1, %g1, %g2 ta 0x8a Weak encryption reversible, allows code scanning mov %g4, %o1 ret
Drawbacks of previous ISR works No page sharing Impractical S/W decryption Slow Weak encryption Easily reversible
Strong Code Encryption + Code randomization + Key Secrecy + Page Sharing = Use ISR against code-reuse attacks
Strong Code Encryption + Code randomization + Key Secrecy + Page Sharing = Use ISR against code-reuse attacks Prevent code reversing
Strong Code Encryption + Code randomization + Key Secrecy + Page Sharing = Use ISR against code-reuse attacks Prevent predictable code layout
Strong Code Encryption + Code randomization + Key Secrecy + Page Sharing = Use ISR against code-reuse attacks Prevent key leaks
Strong Code Encryption + Code randomization + Key Secrecy + Page Sharing = Use ISR against code-reuse attacks Allows shared libs and copy-on-write
Strong Code Encryption + Code randomization + Key Secrecy + Page Sharing = Use ISR against code-reuse attacks
Strong Code Encryption + Code randomization + Key Secrecy + Page Sharing = Use ISR against code-reuse attacks Bonus: Works for the entire kernel and bootloader!
AES <Code> Code Page ITLB DTLB I-cache … Translation Pipeline ECIES ISR PTE H/W Page Walker … D-cache MMU Page Table
Page Miss AES <Code> ITLB Code Page ISR PTE Regular PTE I-cache 10 … Translation ECIES Key ISR PTE H/W Page Walker … MMU Page Table
Page Miss AES <Code> ITLB Code Page Translation I-cache … Translation ECIES ISR PTE H/W Page Walker … MMU Page Table
Address Instruction Miss AES + AES <Code> ITLB Code Page Translation Parallelize decryption and fetch I-cache … Translation ECIES ISR PTE H/W Page Walker … MMU Page Table
Address Instruction Miss AES <Code> + AES <Code> ITLB <Code> Code Page Translation Parallelize decryption and fetch I-cache … Translation ECIES ISR PTE H/W Page Walker … MMU Page Table
Address Instruction Miss AES <Code> + AES <Code> ITLB <Code> Code Page Translation 4.6% slower on prototype, much less so on actual systems! I-cache … Translation ECIES ISR PTE H/W Page Walker … MMU Page Table
Polyglot in action Bootloader
Polyglot in action User application
Conclusion Polyglot counters state-of-the-art code reuse attacks Practical and performant despite using strong encryption “On” from the very first instruction executed Polyglot revamps ISR to make it effective in the modern era while being fast, expansive, and practical
[extra] Page Table Page Table Value Format 2 1 0 31 Page Table // Lvl 2 Page Table // Lvl 1 Regular PTE 10 Regular PTD 01 ISR PTE 11 Regular PTE ISR PTD 10 Key
[extra] Binary Creation ELF Header ELF Header ELF Header … … … .text .text .text Code Page … … … Code Page … … … .isr_map … Keys asymmetrically encrypted ISR Asymmetric Keys
[Extra] Evaluation • Modified Leon3-based SPARC32 platform implemented in FPGA • Fully encrypted bootloader + Linux + apps + shared libraries
[extra] distribution ecosystem App request Download request with public key Download request with unique ID Binary App DB Encrypt Encrypted binary Encrypted binary User key Unique ID User User App Server Key DB Gateway (a) (b)
[extra] related work • Oxymoron • Readactor, Readactor++ • Heisenbyte • CPI • Dynamic rerandomization • Execute-only memory