SlideShare a Scribd company logo
UniSan: Proactive Kernel
Memory Initialization to Eliminate
Data Leakages
Kangjie Lu, Chengyu Song, Taesoo Kim, and Wenke Lee
SSlab, Georgia Institute of Technology
ACM CCS ‘16
Outline
‱ Kernel Information Leaks
‱ Related Work
‱ Design and Implementation
‱ Evaluation
‱ Discussion and Future Work
Kernel Information Leaks
Security mechanisms in OS kernels
‱ kASLR
‱ Randomizing the address of code/data
‱ Preventing code-reuse and privilege escalation attacks
‱ StackGuard
‱ Inserting random canary in stack
‱ Preventing stack corruption-based attacks
Main causes of information leaks
‱ Uninitialized data read: Reading data before
initialization, which may contain uncleared sensitive
data
‱ Out-of-bound read: Reading across object
boundaries
‱ Use-after-free: Using freed pointer/size that can be
attacker controlled
‱ Others: Missing permission check, race condition
About 60% kernel information leaks
are caused by uninitialized data read
From uninitialized data read to leak
Troublemaker: developer
Troublemaker: developer
leak to user space
Troublemaker: developer
function pointer
Troublemaker: compiler
size = 8 bytes
Zero initialization?
‱ C99: padding bytes take unspeciïŹed values
‱ C11: yes or no
Related Work
‱ Kernel leak detection and prevention
‱ check if there is no assignment or memset between the allocation and
copy_to_user
‱ STACKLEAK: clears the used kernel stack when the control is transferred
back to the user space
‱ Detecting uninitialized memory accesses
‱ -Wuninitialized: intra-procedural analysis
‱ dynamic tracking: >10x overhead
‱ MemorySanitizer: 3-4x overhead
‱ Protections using zero-initialization
Design and Implementation
UniSan approach
‱ Compiler-based approach (LLVM)
‱ Conservatively identify unsafe allocations (i.e., with
potential leaks) via static program analysis
‱ Instrument the code to initialize only unsafe
allocations
LLVM
Google “LLVM for Grad Students” for more!
Group meeting: UniSan - Proactive Kernel Memory Initialization to Eliminate Data Leakages
DeïŹning Sources and Sinks
‱ Sources
‱ For stack: AllocaInst
‱ For heap: kmalloc, kmem_cache_alloc, 

‱ __GFP_ZERO ïŹ‚ag
‱ Sinks
‱ copy_to_user, sock_sendmsg, vfs_write, 

int a;
%a = alloca i32
DeïŹning Sources and Sinks
‱ for any data to leave kernel space, it will always be
stored to a non-kernel-stack location (or non-
AllocaInst to be speciïŹc)
‱ Rule 1: A StoreInst is a sink if the destination is not
allocated by an AllocaInst in kernel
‱ Rule 2: A CallInst is a sink if the called value is
inline assembly that is not in the whitelist
‱ Rule 3: A CallInst is a sink if the called function’s
body is empty
Building Global Call-Graph
‱ inter-procedural analysis
‱ For address-taken functions (function pointer)
‱ type-analysis-based approach to ïŹnd the targets
of indirect calls
Recursive Detection
Algorithm
‱ Given an allocation
‱ build its user-graph
‱ recursively keep track the initialization status
and whether reaching sink functions
X
Tracking Different Users
‱ LoadInst
‱ StoreInst
‱ CallInst
‱ GEPOperator
‱ ReturnInst
‱ CastInst
Tracking Different Users
‱ LoadInst
‱ %b = load i32, i32* %a
‱ StoreInst
‱ store i32* %a, i32** %b
‱ store i32 0, i32* %a
↑ independently track, then merge ↑
↑alias analysis,
independently track,
then merge
↑initialization
Tracking Different Users
‱ CallInst
‱ recursively track the arguments in callees
‱ inline assembly
‱ sink functions
Tracking Different Users
‱ GEPOperator
‱ %b = getelementptr inbounds
%struct.foo, %struct.foo* %a, i32 0,
i32 2
‱ creates an alias of the tracked value
‱ non-constant indices
Tracking Different Users
‱ ReturnInst
‱ use the global call-graph to ïŹnd all CallInsts
that call the current function containing the
ReturnInst
‱ independently tracked -> merged
Instrumenting Unsafe
Allocations
‱ For stack
‱ StoreInst
‱ memset()
‱ For heap
‱ __GFP_ZERO ïŹ‚ag
Instrumenting Unsafe
Allocations
‱ For dynamic allocation
‱ record size value during initialization analysis
‱ check whether initialized by memset using the
same size
‱ if yes, instrument to compute the size then pass
to memset to initialize
Evaluation
Platform
‱ Latest mainline Linux kernel for x86_64
‱ with patches from LLVMLinux
‱ Latest Android kernel for AArch64
Accuracy
9% 14%
Effectiveness
‱ Known leaks: 43 recent kernel uninitialized data
leaks reported after 2013
‱ Unknown leaks
EfïŹciency
‱ For system operation
EfïŹciency
‱ For user space program (x86_64)
‱ For user space program (AArch64)
EfïŹciency
Miscellaneous
‱ Analyses took less 3 minutes
‱ Binary size increased < 0.5%
Discussion and Future Work
‱ Custom heap allocator
‱ Source code requirement
‱ Security impacts of zero-initialization
‱ False positives
‱ More kernel modules
‱ Beyond kernels
Contribution
‱ Survey of kernel information leaks
‱ Development of new protection mechanism
‱ Discoveries of new vulnerabilities
Try UniSan:
https://github.com/sslab-gatech/unisan

More Related Content

PDF
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
PDF
CNIT 126 12: Covert Malware Launching
PPTX
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
PDF
Practical Malware Analysis Ch13
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
PDF
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
PDF
CNIT 152: 9 Network Evidence
PDF
CNIT 126 Ch 11: Malware Behavior
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
CNIT 126 12: Covert Malware Launching
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Practical Malware Analysis Ch13
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 152: 9 Network Evidence
CNIT 126 Ch 11: Malware Behavior

What's hot (20)

PDF
CNIT 129S Ch 9: Attacking Data Stores (Part 2 of 2)
PPTX
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
PPTX
Concepts of Malicious Windows Programs
PDF
CNIT 126 13: Data Encoding
PDF
9: OllyDbg
PDF
Practical Malware Analysis: Ch 11: Malware Behavior
PDF
CNIT 126 11. Malware Behavior
PDF
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
PDF
Practical Malware Analysis: Ch 9: OllyDbg
PDF
Practical Malware Analysis: Ch 8: Debugging
PDF
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
PDF
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
PDF
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
PDF
CNIT 126: Ch 2 & 3
PDF
CNIT 152 12 Investigating Windows Systems (Part 2)
PPTX
DevSecCon Singapore 2018 - System call auditing made effective with machine l...
PDF
CNIT 127: L9: Web Templates and .NET
PDF
CNIT 152: 9 Network Evidence
PDF
CNIT 126 Ch 9: OllyDbg
CNIT 129S Ch 9: Attacking Data Stores (Part 2 of 2)
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
CNIT 126: 10: Kernel Debugging with WinDbg
Concepts of Malicious Windows Programs
CNIT 126 13: Data Encoding
9: OllyDbg
Practical Malware Analysis: Ch 11: Malware Behavior
CNIT 126 11. Malware Behavior
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis: Ch 9: OllyDbg
Practical Malware Analysis: Ch 8: Debugging
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126: Ch 2 & 3
CNIT 152 12 Investigating Windows Systems (Part 2)
DevSecCon Singapore 2018 - System call auditing made effective with machine l...
CNIT 127: L9: Web Templates and .NET
CNIT 152: 9 Network Evidence
CNIT 126 Ch 9: OllyDbg
Ad

Similar to Group meeting: UniSan - Proactive Kernel Memory Initialization to Eliminate Data Leakages (20)

PPTX
Metasploit & Windows Kernel Exploitation
PPTX
Practical Windows Kernel Exploitation
PDF
Secure Coding in C/C++
PDF
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
PDF
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
PDF
Dude where's my droid
PPT
Code Quality - Security
PPTX
Operating system enhancements to prevent misuse of systems
PPTX
The basics of hacking and penetration testing 읎제 시작읎알 핮í‚čêłŒ ìčšíˆŹ 테슀튞 kenneth.s.kwon
PPTX
SAST, CWE, SEI CERT and other smart words from the information security world
PDF
Open Source Cyber Weaponry
PPTX
DIY Java Profiling
PDF
CNIT 127: Ch 18: Source Code Auditing
PPTX
Exploring Java Heap Dumps (Oracle Code One 2018)
PDF
unit 2 confinement techniques.pdf
PPTX
06.1 .Net memory management
PPTX
CodeChecker Overview Nov 2019
PPTX
Understanding container security
PDF
Analyzing Kernel Security and Approaches for Improving it
PDF
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Metasploit & Windows Kernel Exploitation
Practical Windows Kernel Exploitation
Secure Coding in C/C++
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
Dude where's my droid
Code Quality - Security
Operating system enhancements to prevent misuse of systems
The basics of hacking and penetration testing 읎제 시작읎알 핮í‚čêłŒ ìčšíˆŹ 테슀튞 kenneth.s.kwon
SAST, CWE, SEI CERT and other smart words from the information security world
Open Source Cyber Weaponry
DIY Java Profiling
CNIT 127: Ch 18: Source Code Auditing
Exploring Java Heap Dumps (Oracle Code One 2018)
unit 2 confinement techniques.pdf
06.1 .Net memory management
CodeChecker Overview Nov 2019
Understanding container security
Analyzing Kernel Security and Approaches for Improving it
Lions, Tigers and Deers: What building zoos can teach us about securing micro...
Ad

More from Yu-Hsin Hung (8)

PDF
IoT/M2M Security
PDF
Android Binder IPC for Linux
PDF
Project meeting: Android Graphics Architecture Overview
PDF
Project meeting: SVMP - Secure Virtual Mobile Platform
PDF
Group meeting: TaintPipe - Pipelined Symbolic Taint Analysis
PDF
Group meeting: Polaris - Faster Page Loads Using Fine-grained Dependency Trac...
PDF
Group meeting: Identifying Information Disclosure in Web Applications with Re...
PDF
DockerVC Hackathon Presentation
IoT/M2M Security
Android Binder IPC for Linux
Project meeting: Android Graphics Architecture Overview
Project meeting: SVMP - Secure Virtual Mobile Platform
Group meeting: TaintPipe - Pipelined Symbolic Taint Analysis
Group meeting: Polaris - Faster Page Loads Using Fine-grained Dependency Trac...
Group meeting: Identifying Information Disclosure in Web Applications with Re...
DockerVC Hackathon Presentation

Recently uploaded (20)

PPTX
ai tools demonstartion for schools and inter college
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Digital Strategies for Manufacturing Companies
PPTX
Transform Your Business with a Software ERP System
PDF
System and Network Administraation Chapter 3
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PPTX
Introduction to Artificial Intelligence
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPT
Introduction Database Management System for Course Database
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Nekopoi APK 2025 free lastest update
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
ai tools demonstartion for schools and inter college
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
VVF-Customer-Presentation2025-Ver1.9.pptx
Digital Strategies for Manufacturing Companies
Transform Your Business with a Software ERP System
System and Network Administraation Chapter 3
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
ISO 45001 Occupational Health and Safety Management System
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
Introduction to Artificial Intelligence
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Navsoft: AI-Powered Business Solutions & Custom Software Development
Introduction Database Management System for Course Database
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Upgrade and Innovation Strategies for SAP ERP Customers
CHAPTER 2 - PM Management and IT Context
How Creative Agencies Leverage Project Management Software.pdf
Nekopoi APK 2025 free lastest update
ManageIQ - Sprint 268 Review - Slide Deck

Group meeting: UniSan - Proactive Kernel Memory Initialization to Eliminate Data Leakages