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

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

The University of Adelaide, School of Computer Science
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
Defenses. Preventing hijacking attacks 1. Fix bugs: – Audit software Automated tools: Coverity, Prefast/Prefix. – Rewrite software in a type safe languange.
Procedures in more detail. CMPE12cGabriel Hugh Elkaim 2 Why use procedures? –Code reuse –More readable code –Less code Microprocessors (and assembly languages)
Computer Architecture CSCE 350
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /17/2013 Lecture 12: Procedures Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Part III Counter measures The best defense is proper bounds checking but there are many C/C++ programmers and some are bound to forget  Are there any.
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
(1) ICS 313: Programming Language Theory Chapter 10: Implementing Subprograms.
Instruction-Set Randomization “Countering Code-Injection Attacks With Instruction-Set Randomization” G. Kc, A. Keromytis, and V. Prevelakis CCS October.
1 Subroutines and Control Abstraction. 2 Control Abstraction Abstraction Abstraction associate a name N to a program part P associate a name N to a program.
1 Storage Registers vs. memory Access to registers is much faster than access to memory Goal: store as much data as possible in registers Limitations/considerations:
Procedures in more detail. CMPE12cCyrus Bazeghi 2 Procedures Why use procedures? Reuse of code More readable Less code Microprocessors (and assembly languages)
CSE 2501 Review Declaring a variable allocates space for the type of datum it is to store int x; // allocates space for an int int *px; // allocates space.
1 Chapter 7: Runtime Environments. int * larger (int a, int b) { if (a > b) return &a; //wrong else return &b; //wrong } int * larger (int *a, int *b)
Rossella Lau Lecture 8, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 8: Polymorphism & C++ pointer  Inheritance.
Intro to Computer Architecture
Catriel Beeri Pls/Winter 2004/5 environment 68  Some details of implementation As part of / extension of type-checking: Each declaration d(x) associated.
PZ09A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ09A - Activation records Programming Language Design.
1 RISE: Randomization Techniques for Software Security Dawn Song CMU Joint work with Monica Chew (UC Berkeley)
Efficient Instruction Set Randomization Using Software Dynamic Translation Michael Crane Wei Hu.
1/25 Pointer Logic Changki PSWLAB Pointer Logic Daniel Kroening and Ofer Strichman Decision Procedure.
Multitasking Mr. Mahendra B. Salunke Asst. Prof. Dept. of Computer Engg., STES SITS, Narhe, Pune-41 STES Sinhgad Institute of Tech. & Science Dept. of.
13/02/2009CA&O Lecture 04 by Engr. Umbreen Sabir Computer Architecture & Organization Instructions: Language of Computer Engr. Umbreen Sabir Computer Engineering.
Runtime Environments Compiler Construction Chapter 7.
Programming Language Principles Lecture 24 Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Subroutines.
Computer Science Detecting Memory Access Errors via Illegal Write Monitoring Ongoing Research by Emre Can Sezer.
Names. 2 Variables  binding is an association between an entity (such as a variable) and a property (such as its value). A binding is static if the association.
Replay Compilation: Improving Debuggability of a Just-in Time Complier Presenter: Jun Tao.
1 Control Abstraction (Section ) CSCI 431 Programming Languages Fall 2003 A compilation of material developed by Felix Hernandez-Campos and Michael.
COP4020 Programming Languages Subroutines and Parameter Passing Prof. Xin Yuan.
An Object-Oriented Approach to Programming Logic and Design Chapter 3 Using Methods and Parameters.
Buffer Overflow Attack-proofing by Transforming Code Binary Gopal Gupta Parag Doshi, R. Reghuramalingam The University of Texas at Dallas 11/15/2004.
Implementing Subprograms What actions must take place when subprograms are called and when they terminate? –calling a subprogram has several associated.
An OBSM method for Real Time Embedded Systems Veronica Eyo Sharvari Joshi.
A.Alzubair Hassan Abdullah Dept. Computer Sciences Kassala University A.Alzubair Hassan Abdullah Dept. Computer Sciences Kassala University NESTED SUBPROGRAMS.
Buffer Overflow Proofing of Code Binaries By Ramya Reguramalingam Graduate Student, Computer Science Advisor: Dr. Gopal Gupta.
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
Part I The Basic Idea software sequence of instructions in memory logically divided in functions that call each other – function ‘IE’ calls function.
Introduction Program File Authorization Security Theorem Active Code Authorization Authorization Logic Implementation considerations Conclusion.
Buffer Overflow Attack- proofing of Code Binaries Ramya Reguramalingam Gopal Gupta Gopal Gupta Department of Computer Science University of Texas at Dallas.
RUNTIME ENVIRONMENT AND VARIABLE BINDINGS How to manage local variables.
A Survey on Runtime Smashed Stack Detection 坂井研究室 M 豊島隆志.
ISBN Chapter 10 Implementing Subprograms.
Beyond Stack Smashing: Recent Advances In Exploiting Buffer Overruns Jonathan Pincus and Brandon Baker Microsoft Researchers IEEE Security and.
Buffer Overflows: Attacks and Defenses for the Vulnerability of the Decade Crispin Cowan SANS 2000.
Memory Protection through Dynamic Access Control Kun Zhang, Tao Zhang and Santosh Pande College of Computing Georgia Institute of Technology.
Storage Classes There are three places in memory where data may be placed: In Data section declared with .data in assembly language in C - Static) On the.
Computer Science 210 Computer Organization
ENERGY 211 / CME 211 Lecture 25 November 17, 2008.
Procedures (Functions)
Procedures (Functions)
Names.
Advanced Buffer Overflow: Pointer subterfuge
Chap. 8 :: Subroutines and Control Abstraction
Chap. 8 :: Subroutines and Control Abstraction
MIPS Instructions.
Classes and Objects.
PZ09A - Activation records
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Computer Architecture
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
MIPS R3000 Subroutine Calls and Stack
Topic 2b ISA Support for High-Level Languages
Return-to-libc Attacks
Presentation transcript:

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: (1) return address on AR (2) function pointers Explore the role of microarchitecture and compiler. The closest related project is StackGuard and PointGuard.

The 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.

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.

Microarchitectural Version The set of actions taken on linking jumps/branches includes: MEM[$sp] e($PC); Encoding Function: e($PC) = $PC $fp;

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

Encoding/Decoding Key Selection Direct 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.

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.

Return 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.

Compiler-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.

Current Project Status Project started Nov 1, Gcc modified to incorporate the encoding/decoding. Linux and libraries recompiled with the PC encoding gcc. Conceptual development for function pointer protection.

Function 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.

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.

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.

Conclusions Microarchitecture offers efficiency, transparency, and a truly private encoding key. The approach may be extensible to larger objects than the program pointer objects.