encoded pc: self protection from buffer overflow attacks

16
Encoded PC: Self Encoded PC: Self Protection from Buffer Protection from Buffer Overflow Attacks Overflow Attacks Akhilesh Tyagi Depts: Elec. & Computer Engg; Computer Science Iowa State University

Upload: truman

Post on 07-Jan-2016

15 views

Category:

Documents


1 download

DESCRIPTION

Encoded PC: Self Protection from Buffer Overflow Attacks. Akhilesh Tyagi Depts: Elec. & Computer Engg; Computer Science Iowa State University. ATIAS Program (FRT#1). Prof. Gyung-Ho Lee Prof. Akhilesh Tyagi 2 Graduate students. Project Goals. Protection of Program Pointers: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Encoded PC: Self Protection from Buffer Overflow Attacks

Encoded PC: Self Protection Encoded PC: Self Protection from Buffer Overflow Attacksfrom Buffer Overflow Attacks

Akhilesh Tyagi

Depts: Elec. & Computer Engg;

Computer Science

Iowa State University

Page 2: Encoded PC: Self Protection from Buffer Overflow Attacks

ATIAS Program (FRT#1)ATIAS Program (FRT#1)

Prof. Gyung-Ho Lee

Prof. Akhilesh Tyagi

2 Graduate students

Page 3: Encoded PC: Self Protection from Buffer Overflow Attacks

Project GoalsProject Goals

Protection of Program Pointers: (1) return address on AR (2) function pointers

Explore the role of microarchitecture and compiler.

The closest related project is StackGuard and PointGuard.

Page 4: Encoded PC: Self Protection from Buffer Overflow Attacks

The Main IdeaThe Main Idea

Memory is a public area – open to attacks.

Any Program Counter (PC) bound value v encoded through an encoding function e(v).

Decoded d(e(v)) = v before being placed in PC.

Page 5: Encoded PC: Self Protection from Buffer Overflow Attacks

Return Address:

A valid PC bound value goes through both encoding, e, and decoding, d, functions in a

PC-Memory-PC roundtrip.

A compromised value only goes through the decoding function d redirecting the attack to

d(A) instead of the intended address A.

Page 6: Encoded PC: Self Protection from Buffer Overflow Attacks

Microarchitectural VersionMicroarchitectural Version

The set of actions taken on linking jumps/branches includes:

MEM[$sp] e($PC);

Encoding Function:

e($PC) = $PC $fp;

Page 7: Encoded PC: Self Protection from Buffer Overflow Attacks

Decoding:

Instructions to pop the return address into PC can decode: jr $ra or rts

$PC $ra $fp

Page 8: Encoded PC: Self Protection from Buffer Overflow Attacks

Encoding/Decoding Key Encoding/Decoding Key SelectionSelectionDirect protection: In order to protect

an object at address A, it is not sufficient to protect the surrounding addresses: A+i and A-i for i=1,2, …, k.

Dynamically variable keys: A new value for each protected object instance.

Page 9: Encoded PC: Self Protection from Buffer Overflow Attacks

Key characteristics continued:Key characteristics continued:

Non-reproducibility: Attacker has access to identical software and hardware environment.

Key = $fp random #

Register-resident keys: Most paranoid model is to assume that all memory-resident values are susceptible.

Page 10: Encoded PC: Self Protection from Buffer Overflow Attacks

Return Address StackReturn Address Stack

Most ILP microarchitectures include 8-16 deep stack of most recent return addresses for return address prediction.

Covers over 90% of nesting depths in practice.

It can also be used to supplement the encoding/decoding schemes.

Page 11: Encoded PC: Self Protection from Buffer Overflow Attacks

Compiler-assisted VersionCompiler-assisted Version

The microarchitecture actions can also be implemented in the compiler.

jal / jsr actions can go into the prologue for the

procedure.

jr / rts actions go into the epilogue.

Page 12: Encoded PC: Self Protection from Buffer Overflow Attacks

Current Project StatusCurrent Project Status

Project started Nov 1, 2000.Gcc modified to incorporate the

encoding/decoding.Linux and libraries recompiled with

the PC encoding gcc.Conceptual development for function

pointer protection.

Page 13: Encoded PC: Self Protection from Buffer Overflow Attacks

Function Pointer ProtectionFunction Pointer Protection

Similar encoding/decoding: *fp = address replaced by *fp = e(address) = address key.

Dereferencing leads to decoding: foo = *fp replaced by foo = d(*fp) = *fp key or

(*fp)() replaced by ((*fp) key)(). Microarchitecture alone does not suffice:

assignment to a function pointer results in a store – compiler needs to distinguish the function pointer assignments.

Page 14: Encoded PC: Self Protection from Buffer Overflow Attacks

Func. Pointer Protection Contd.Func. Pointer Protection Contd.

Key selection: many choices to satisfy the stated properties. Some combination of PID, FP address, compiler generated call path signature will work.

Where/when to encode and decode?Compiler can attribute declarations

such as (void) (*fp)() to type a subset of pointers as function pointers.

Page 15: Encoded PC: Self Protection from Buffer Overflow Attacks

Func. Pointer Protection Contd.Func. Pointer Protection Contd.

Decoding instructions can be inserted at the dereferencing points for the tagged function pointers or inside the prologue of the function.

Encoding at the linking/loading time or through PC-bound static analysis for limited cases.

Page 16: Encoded PC: Self Protection from Buffer Overflow Attacks

ConclusionsConclusions

Microarchitecture offers efficiency, transparency, and a truly private encoding key.

The approach may be extensible to larger objects than the program pointer objects.