Top Banner
Comprehensively and Efficiently Protecting the Heap - Kharbutli, Jiang, Solihin, Venkataramani, Prvulovic, ASPLOS 2006 Shimin Chen (LBA Reading Group Presentation)
25

Shimin Chen (LBA Reading Group Presentation)

Feb 06, 2016

Download

Documents

onawa

Comprehensively and Efficiently Protecting the Heap - Kharbutli, Jiang, Solihin, Venkataramani, Prvulovic, ASPLOS 2006. Shimin Chen (LBA Reading Group Presentation). Motivation. Security attacks often Modify control flow e.g. function pointer, return addr, branch target - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Shimin Chen (LBA Reading Group Presentation)

Comprehensively and Efficiently Protecting the Heap- Kharbutli, Jiang, Solihin, Venkataramani, Prvulovic, ASPLOS 2006

Shimin Chen

(LBA Reading Group Presentation)

Page 2: Shimin Chen (LBA Reading Group Presentation)

Motivation

Security attacks often Modify control flow

e.g. function pointer, return addr, branch target

Modify critical datae.g. cgi-bin path

Focus of this paper: heap attacks

Page 3: Shimin Chen (LBA Reading Group Presentation)

Current Heap Management Schemes

Meta data and app data are interleaved

Not protected from each other Predictability of layout

Unsafe: Vulnerable to meta data corruption Easily figure out critical locations

Page 4: Shimin Chen (LBA Reading Group Presentation)

Heap Attacks’ Three Stages

1. Bug exploitation stage: e.g. buffer overflow

2. Activation stage: e.g. corrupted meta-data causes heap lib to overwrite app critical data or function pointers

3. Seized stage: e.g. program behavior is altered

More ways to carry out later stages than earlier stages

Page 5: Shimin Chen (LBA Reading Group Presentation)

Heap Protection

1. Bug exploitation stage2. Activation stage3. Seized stage

Focus on one or more of the stages Previous schemes focus on stage 2 or 3,

assuming particular steps being carried out by attackse.g. non-executable heap

This paper focuses on stage 1 Protect against corruption

Page 6: Shimin Chen (LBA Reading Group Presentation)

Solution: Heap Server

A separate process manages app heaps:

Meta data in separate address space Layout obfuscation of heap data

Page 7: Shimin Chen (LBA Reading Group Presentation)

Outline

Heap Attacks Heap Server Evaluation Conclusion

Page 8: Shimin Chen (LBA Reading Group Presentation)

Forward Consolidation Attack:(1) Before Attack

• GNU C Library

• Free chunks are in a doubly linked list

• Fd: forward pointer

• Bk: backward pointer

B->fd->bk = B->bk;

B->bk->fd = B->fd;

Page 9: Shimin Chen (LBA Reading Group Presentation)

Forward Consolidation Attack:(2) Buffer Overflow

B->fd->bk = B->bk;

B->bk->fd = B->fd;

Page 10: Shimin Chen (LBA Reading Group Presentation)

Forward Consolidation Attack:(3) Activation: B removed from free list

B->fd->bk = B->bk;

B->bk->fd = B->fd;

Page 11: Shimin Chen (LBA Reading Group Presentation)

Outline

Heap Attacks Heap Server Evaluation Conclusion

Page 12: Shimin Chen (LBA Reading Group Presentation)

Heap Server Protection Mechanisms

1. Store meta-data separately from data New bitmapped meta-data organization

2. Store meta-data in a separate process

Inter-process messaging

3. Obfuscate heap layout

Page 13: Shimin Chen (LBA Reading Group Presentation)

Bitmapped Meta-Data

Efficiency: 2 bits/8 bytes, O(1) A large number of small malloc/free Tree or hash table can be expensive

Chunk size if long enough

Page 14: Shimin Chen (LBA Reading Group Presentation)

Traditional

Unoptimized

Non-blocking

Heap Server

• non-blocking free

• batch frees

• book-keep in background

Pre-allocation of frequent sizes

Page 15: Shimin Chen (LBA Reading Group Presentation)

Obfuscation Address obfuscation

Insert padding between data chunks Random: [0, min(64,

12.5%*chunk_size)] Layout obfuscation

Reduce predictability of chunk ordering Random recycling Skip random number in [0,16] of nodes

on free list

Page 16: Shimin Chen (LBA Reading Group Presentation)

Outline

Heap Attacks Heap Server Evaluation Conclusion

Page 17: Shimin Chen (LBA Reading Group Presentation)

Methodology Machine: 2-way SMP, 2GHz Xeon with HT,

512KB L2, 512MB RDRAM Red Hat 8.0, Kernel 2.4.20 GCC version 3.2, –O3 Benchmarks: SPEC INT 2000, SPEC FP 2000,

and allocation intensive benchmarks

Page 18: Shimin Chen (LBA Reading Group Presentation)
Page 19: Shimin Chen (LBA Reading Group Presentation)

Attack Avoidance

Avoid two real-world attacks WU-ftpd and Sudo

Avoid attacks on synthetic example Buffer overflow beyond padding can

corrupt app data and cause crashes If heap data contains function pointer,

then it is possible to hijack control flow

Page 20: Shimin Chen (LBA Reading Group Presentation)

Benchmark Characteristics

Average heap request size of benchmarks: 2 bytes - 235 bytes.

Page 21: Shimin Chen (LBA Reading Group Presentation)

Execution Time Overheads

Page 22: Shimin Chen (LBA Reading Group Presentation)

NB: non-blocking, BD: batch de-allocation (free), PA: pre-allocation, Prot: protecting pre-allocation data pointers in app space

Impact of Optimizations

Page 23: Shimin Chen (LBA Reading Group Presentation)

Conclusion

Heap server protects heap meta-data Minimal assumptions Low overhead Existing hardware Few code modifications

Page 24: Shimin Chen (LBA Reading Group Presentation)

Backup Slides

Page 25: Shimin Chen (LBA Reading Group Presentation)

Related Work Non-executable heap, tracking info

flow, program shepherding Transparent Runtime Randomization Address Space Layout Randomization Address Obfuscation PointGuard DieHard: similar to Heap Server but in

the same address space