SlideShare a Scribd company logo
Remix: On-demand Live Randomization
Yue Chen, Zhi Wang, David Whalley, Long Lu
Florida State University
Stony Brook University
6th ACM Conference on Data and Applications Security and Privacy, New Orleans, LA, USA
Code Reuse Attack
• Buffer Overflow -> Code Injection Attack
Code Reuse Attack
• Buffer Overflow -> Code Injection Attack
– Defense: Data Execution Prevention (DEP)
• Write XOR Execute
Code Reuse Attack
• Buffer Overflow -> Code Injection Attack
– Defense: Data Execution Prevention (DEP)
• Write XOR Execute
• Return-oriented Programming Attack
– Discover gadgets from existing code, chain them
by ret instruction
– Turing complete
Code Reuse Attack
Existing Code
Chained Gadgets
ASLR
Address Space Layout Randomization
Executable
Library1
Library1
Executable
ASLR - Problem
Library1
Executable
Pointer Leak
ASLR - Problem
Library1
Executable
Pointer Leak
De-randomized
Goal
• Live randomization during runtime
• Finer-grained randomization unit
• Low performance overhead
Remix
Live basic block (BB) randomization within functions
Remix
Live basic block (BB) randomization within functions
Advantages:
No function pointer migration
Good spatial locality
Remix
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Space for
Alignment
Other Functions
…
Function A
Remix
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Space for
Alignment
Other Functions
…
Function A
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Other Functions
…
Function A
After
0.86 seconds
Remix
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Space for
Alignment
Other Functions
…
Function A
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Other Functions
…
Function A
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Other Functions
…
Function A
After
0.86 seconds
After
2.13 seconds
Challenges
• Chain randomized basic blocks together
– Need extra space
– Instruction update
• Stale pointer migration
Extra Space
Case 1: Extra Jmp
Basic Block 1
Basic Block 2
Basic Block 3
Jmp to BB1
(1) At the Beginning of a Function
Extra Space
Case 1: Extra Jmp
Basic Block 1
Basic Block 2
Basic Block 3
Jmp to BB1
(1) At the Beginning of a Function (2) At the End of a Basic Block that does
not end with instructions like Jmp/Ret
mov …
add …
mov …
mov …
add …
jle …
Extra Space
Case 2: Displacement Length
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Jump to BB3
Before Remix
Extra Space
Case 2: Displacement Length
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Jump to BB3 Jump to BB3
Before Remix After Remix
Extra Space
Case 2: Displacement Length
One-byte displacement:
jmp +0x10
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Jump to BB3 Jump to BB3
Four-byte displacement:
jmp +0x00001000
Before Remix After Remix
Extra Space
Solution
With Source Code:
Modify the compiler to:
1. Insert an extra 5-byte NOP
instruction after each basic block
2. Only generate instructions with
4-byte displacement
 Enough Space Guaranteed!
Extra Space
Solution
With Source Code:
Modify the compiler to:
1. Insert an extra 5-byte NOP
instruction after each basic block
2. Only generate instructions with
4-byte displacement
 Enough Space Guaranteed!
Without Source Code:
Leverage existing NOP paddings:
• Function alignment
• Loop alignment
Instruction Update
Q: Which instructions need updating ?
Instruction Update
Q: Which instructions need updating ?
A: Control-flow related ones
Instruction Update
Two-step update (e.g., unconditional direct jmp):
Basic Block 1
Basic Block 2
Basic Block 3
Original After BB Reordering
Step one:
Jumps to Original
Address of BB 3
Step two:
Jumps to Current
Address of BB 3
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 1
Basic Block 2
Basic Block 3
jmp
Instruction Update
• Direct call: Step-one update
• Indirect call: No update needed
• Direct jump: Step-one and step-two update
• Indirect jump: Discussed later
• PC-relative addressing: Step-one update
Indirect Jump
• Jump to functions – Unmoved
– PLT/GOT
– Tail/Sibling Call
• Jump to basic blocks – See next
Basic Block Pointer Conversion
• Why?
- Migrate stale pointers to basic blocks, to ensure
correctness
Basic Block Pointer Conversion
• Why?
- Migrate stale pointers to basic blocks, to ensure
correctness
• Where?
- Return address
- Jump table (switch/case)
- Saved context (e.g., setjmp/longjmp)
- Kernel exception table
…
Optimization
 Speed up randomization procedure:
• Metadata Maintenance
– Basic block information (e.g., location)
– Code/data that need updating
Optimization
 Speed up execution:
• Probabilistic Loop Bundling
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Loop
Optimization
 Speed up execution:
• Probabilistic Loop Bundling
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Loop
Basic Block 1
Bundled BB
Basic Block 4
Basic Block 5
Bundle
Optimization
 Speed up execution:
• Probabilistic Loop Bundling
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Loop
Basic Block 1
Bundled BB
Basic Block 4
Basic Block 5
Basic Block 1
Bundled BB
Basic Block 4
Basic Block 5
Bundle Randomize
Bundle
Optimization
 Speed up execution:
• Probabilistic Loop Bundling
Basic Block 1
Basic Block 2
Basic Block 3
Basic Block 4
Basic Block 5
Loop
Basic Block 1
Bundled BB
Basic Block 4
Basic Block 5
The bundling layout is different from time to time. – Unpredictable!
Basic Block 1
Bundled BB
Basic Block 4
Basic Block 5
Randomize
Implementation
• Compiler
– Slightly modified LLVM
• Linux userspace applications
– Ptrace, an isolated small agent to perform the
randomization
• Freebsd kernel modules
– smp_rendezvous
Evaluation - Security
• Finer-grained randomization:
– Entropy boost
• Live randomization during runtime:
– Destroy discovered gadgets immediately
Software Apache nginx lighttpd
Average Basic Block Number
per Function
15.3 18.8 14.4
Average NOP Space (bytes)
per Function
19.3 26.2 22.1
Want more entropy? – Insert more NOP space!
Evaluation - Performance
SPEC CPU 2006 Performance Overhead
Evaluation - Performance
SPEC CPU 2006 Size Increase
Evaluation - Performance
Apache Web Server Performance Overhead (by ApacheBench)
Randomization Time Interval
Randomization time interval can be random !Performance depends on hardware speed.
Evaluation - Performance
ReiserFS Performance Overhead (by IOZone)
Randomization Time Interval
Randomization time interval can be random !Performance depends on hardware speed.
Q&A

More Related Content

PDF
Efficient Bytecode Analysis: Linespeed Shellcode Detection
PPTX
Intel processor trace - What are Recorded?
PPTX
Os lectures
PPTX
Threads in Operating System | Multithreading | Interprocess Communication
PPTX
BAM experiences in large scale deployments
PPTX
Release Cycle Changes
PPTX
Process management in operating system | process states | PCB | FORK() | Zomb...
PDF
File Systems: Why, How and Where
Efficient Bytecode Analysis: Linespeed Shellcode Detection
Intel processor trace - What are Recorded?
Os lectures
Threads in Operating System | Multithreading | Interprocess Communication
BAM experiences in large scale deployments
Release Cycle Changes
Process management in operating system | process states | PCB | FORK() | Zomb...
File Systems: Why, How and Where

Viewers also liked (20)

DOCX
Rashid new cv 2014
PDF
A Perspective from the intersection Data Science, Mobility, and Mobile Devices
PDF
White paper hadoop performancetuning
PPTX
Data Infused Product Design and Insights at LinkedIn
PDF
Impala SQL Support
PPTX
Admission Control in Impala
PDF
Cloudera Impala Source Code Explanation and Analysis
PPTX
Apache Impala (incubating) 2.5 Performance Update
PDF
Hadoop application architectures - Fraud detection tutorial
PPTX
How to use your data science team: Becoming a data-driven organization
PDF
SecPod: A Framework for Virtualization-based Security Systems
PPTX
Data Modeling for Data Science: Simplify Your Workload with Complex Types in ...
PDF
Nested Types in Impala
PDF
Architecting next generation big data platform
PPTX
Faster Batch Processing with Cloudera 5.7: Hive-on-Spark is ready for production
PDF
What no one tells you about writing a streaming app
PPTX
Hoodie: Incremental processing on hadoop
PDF
Top 5 mistakes when writing Spark applications
PDF
Top 5 mistakes when writing Spark applications
PDF
Streaming architecture patterns
Rashid new cv 2014
A Perspective from the intersection Data Science, Mobility, and Mobile Devices
White paper hadoop performancetuning
Data Infused Product Design and Insights at LinkedIn
Impala SQL Support
Admission Control in Impala
Cloudera Impala Source Code Explanation and Analysis
Apache Impala (incubating) 2.5 Performance Update
Hadoop application architectures - Fraud detection tutorial
How to use your data science team: Becoming a data-driven organization
SecPod: A Framework for Virtualization-based Security Systems
Data Modeling for Data Science: Simplify Your Workload with Complex Types in ...
Nested Types in Impala
Architecting next generation big data platform
Faster Batch Processing with Cloudera 5.7: Hive-on-Spark is ready for production
What no one tells you about writing a streaming app
Hoodie: Incremental processing on hadoop
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applications
Streaming architecture patterns
Ad

Similar to Remix: On-demand Live Randomization (Fine-grained live ASLR during runtime) (20)

PDF
Automated deployments using envoy by John Blackmore
PDF
Db2-for-zOS-Hot-Topics-and-Best-Practices-with-John-Campbell-Part-1.pdf
PDF
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
PPTX
Exploiting the windows kernel
PDF
Search at Twitter: Presented by Michael Busch, Twitter
PDF
es_hardware_handout
PDF
CNIT 127: Ch 2: Stack Overflows in Linux
PPTX
Kafka Summit NYC 2017 - Deep Dive Into Apache Kafka
PDF
Asynchronous Programming in Kotlin with Coroutines
PDF
5. Stream Ciphers
PDF
127 Ch 2: Stack overflows on Linux
PDF
CNIT 127: Ch 2: Stack overflows on Linux
PDF
Make static instrumentation great again, High performance fuzzing for Windows...
PPTX
Python Multiprocessing Spoon-fed - Blue Raster Esri Developer Summit 2013 Lig...
PDF
DEF CON 27 - JEFF DILEO - evil e bpf in depth
PPT
Chapter 02 modified
PDF
Ch5 process synchronization
PPTX
Kafka replication apachecon_2013
PDF
2016-jenkins-world-jenkins_and_load_sharing_facility_lsf_enables_rapid_delive...
PPTX
Practical Windows Kernel Exploitation
Automated deployments using envoy by John Blackmore
Db2-for-zOS-Hot-Topics-and-Best-Practices-with-John-Campbell-Part-1.pdf
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Exploiting the windows kernel
Search at Twitter: Presented by Michael Busch, Twitter
es_hardware_handout
CNIT 127: Ch 2: Stack Overflows in Linux
Kafka Summit NYC 2017 - Deep Dive Into Apache Kafka
Asynchronous Programming in Kotlin with Coroutines
5. Stream Ciphers
127 Ch 2: Stack overflows on Linux
CNIT 127: Ch 2: Stack overflows on Linux
Make static instrumentation great again, High performance fuzzing for Windows...
Python Multiprocessing Spoon-fed - Blue Raster Esri Developer Summit 2013 Lig...
DEF CON 27 - JEFF DILEO - evil e bpf in depth
Chapter 02 modified
Ch5 process synchronization
Kafka replication apachecon_2013
2016-jenkins-world-jenkins_and_load_sharing_facility_lsf_enables_rapid_delive...
Practical Windows Kernel Exploitation
Ad

More from Yue Chen (7)

PDF
KARMA: Adaptive Android Kernel Live Patching
PDF
EncExec: Secure In-Cache Execution
PDF
Ravel: Pinpointing Vulnerabilities
PDF
Pinpointing Vulnerabilities (Ravel)
PDF
Inside Parquet Format
PDF
Inside HDFS Append
PDF
How Impala Works
KARMA: Adaptive Android Kernel Live Patching
EncExec: Secure In-Cache Execution
Ravel: Pinpointing Vulnerabilities
Pinpointing Vulnerabilities (Ravel)
Inside Parquet Format
Inside HDFS Append
How Impala Works

Recently uploaded (20)

PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
Well-logging-methods_new................
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Construction Project Organization Group 2.pptx
PPTX
Current and future trends in Computer Vision.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPT
Project quality management in manufacturing
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Well-logging-methods_new................
Embodied AI: Ushering in the Next Era of Intelligent Systems
Construction Project Organization Group 2.pptx
Current and future trends in Computer Vision.pptx
Foundation to blockchain - A guide to Blockchain Tech
UNIT 4 Total Quality Management .pptx
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Project quality management in manufacturing
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Safety Seminar civil to be ensured for safe working.
Fundamentals of Mechanical Engineering.pptx
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Fundamentals of safety and accident prevention -final (1).pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT

Remix: On-demand Live Randomization (Fine-grained live ASLR during runtime)

  • 1. Remix: On-demand Live Randomization Yue Chen, Zhi Wang, David Whalley, Long Lu Florida State University Stony Brook University 6th ACM Conference on Data and Applications Security and Privacy, New Orleans, LA, USA
  • 2. Code Reuse Attack • Buffer Overflow -> Code Injection Attack
  • 3. Code Reuse Attack • Buffer Overflow -> Code Injection Attack – Defense: Data Execution Prevention (DEP) • Write XOR Execute
  • 4. Code Reuse Attack • Buffer Overflow -> Code Injection Attack – Defense: Data Execution Prevention (DEP) • Write XOR Execute • Return-oriented Programming Attack – Discover gadgets from existing code, chain them by ret instruction – Turing complete
  • 5. Code Reuse Attack Existing Code Chained Gadgets
  • 6. ASLR Address Space Layout Randomization Executable Library1 Library1 Executable
  • 9. Goal • Live randomization during runtime • Finer-grained randomization unit • Low performance overhead
  • 10. Remix Live basic block (BB) randomization within functions
  • 11. Remix Live basic block (BB) randomization within functions Advantages: No function pointer migration Good spatial locality
  • 12. Remix Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Space for Alignment Other Functions … Function A
  • 13. Remix Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Space for Alignment Other Functions … Function A Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Other Functions … Function A After 0.86 seconds
  • 14. Remix Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Space for Alignment Other Functions … Function A Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Other Functions … Function A Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Other Functions … Function A After 0.86 seconds After 2.13 seconds
  • 15. Challenges • Chain randomized basic blocks together – Need extra space – Instruction update • Stale pointer migration
  • 16. Extra Space Case 1: Extra Jmp Basic Block 1 Basic Block 2 Basic Block 3 Jmp to BB1 (1) At the Beginning of a Function
  • 17. Extra Space Case 1: Extra Jmp Basic Block 1 Basic Block 2 Basic Block 3 Jmp to BB1 (1) At the Beginning of a Function (2) At the End of a Basic Block that does not end with instructions like Jmp/Ret mov … add … mov … mov … add … jle …
  • 18. Extra Space Case 2: Displacement Length Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Jump to BB3 Before Remix
  • 19. Extra Space Case 2: Displacement Length Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Jump to BB3 Jump to BB3 Before Remix After Remix
  • 20. Extra Space Case 2: Displacement Length One-byte displacement: jmp +0x10 Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Jump to BB3 Jump to BB3 Four-byte displacement: jmp +0x00001000 Before Remix After Remix
  • 21. Extra Space Solution With Source Code: Modify the compiler to: 1. Insert an extra 5-byte NOP instruction after each basic block 2. Only generate instructions with 4-byte displacement  Enough Space Guaranteed!
  • 22. Extra Space Solution With Source Code: Modify the compiler to: 1. Insert an extra 5-byte NOP instruction after each basic block 2. Only generate instructions with 4-byte displacement  Enough Space Guaranteed! Without Source Code: Leverage existing NOP paddings: • Function alignment • Loop alignment
  • 23. Instruction Update Q: Which instructions need updating ?
  • 24. Instruction Update Q: Which instructions need updating ? A: Control-flow related ones
  • 25. Instruction Update Two-step update (e.g., unconditional direct jmp): Basic Block 1 Basic Block 2 Basic Block 3 Original After BB Reordering Step one: Jumps to Original Address of BB 3 Step two: Jumps to Current Address of BB 3 Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 1 Basic Block 2 Basic Block 3 jmp
  • 26. Instruction Update • Direct call: Step-one update • Indirect call: No update needed • Direct jump: Step-one and step-two update • Indirect jump: Discussed later • PC-relative addressing: Step-one update
  • 27. Indirect Jump • Jump to functions – Unmoved – PLT/GOT – Tail/Sibling Call • Jump to basic blocks – See next
  • 28. Basic Block Pointer Conversion • Why? - Migrate stale pointers to basic blocks, to ensure correctness
  • 29. Basic Block Pointer Conversion • Why? - Migrate stale pointers to basic blocks, to ensure correctness • Where? - Return address - Jump table (switch/case) - Saved context (e.g., setjmp/longjmp) - Kernel exception table …
  • 30. Optimization  Speed up randomization procedure: • Metadata Maintenance – Basic block information (e.g., location) – Code/data that need updating
  • 31. Optimization  Speed up execution: • Probabilistic Loop Bundling Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Loop
  • 32. Optimization  Speed up execution: • Probabilistic Loop Bundling Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Loop Basic Block 1 Bundled BB Basic Block 4 Basic Block 5 Bundle
  • 33. Optimization  Speed up execution: • Probabilistic Loop Bundling Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Loop Basic Block 1 Bundled BB Basic Block 4 Basic Block 5 Basic Block 1 Bundled BB Basic Block 4 Basic Block 5 Bundle Randomize
  • 34. Bundle Optimization  Speed up execution: • Probabilistic Loop Bundling Basic Block 1 Basic Block 2 Basic Block 3 Basic Block 4 Basic Block 5 Loop Basic Block 1 Bundled BB Basic Block 4 Basic Block 5 The bundling layout is different from time to time. – Unpredictable! Basic Block 1 Bundled BB Basic Block 4 Basic Block 5 Randomize
  • 35. Implementation • Compiler – Slightly modified LLVM • Linux userspace applications – Ptrace, an isolated small agent to perform the randomization • Freebsd kernel modules – smp_rendezvous
  • 36. Evaluation - Security • Finer-grained randomization: – Entropy boost • Live randomization during runtime: – Destroy discovered gadgets immediately Software Apache nginx lighttpd Average Basic Block Number per Function 15.3 18.8 14.4 Average NOP Space (bytes) per Function 19.3 26.2 22.1 Want more entropy? – Insert more NOP space!
  • 37. Evaluation - Performance SPEC CPU 2006 Performance Overhead
  • 38. Evaluation - Performance SPEC CPU 2006 Size Increase
  • 39. Evaluation - Performance Apache Web Server Performance Overhead (by ApacheBench) Randomization Time Interval Randomization time interval can be random !Performance depends on hardware speed.
  • 40. Evaluation - Performance ReiserFS Performance Overhead (by IOZone) Randomization Time Interval Randomization time interval can be random !Performance depends on hardware speed.
  • 41. Q&A