An Approach to Safe Object Sharing Ciaran Bryce & Chrislain Razafimahefa University of Geneva, Switzerland.

Slides:



Advertisements
Similar presentations
Access Control 1. Given Credit Where It Is Due Most of the lecture notes are based on slides by Dr. Daniel M. Zimmerman at CALTECH Some slides are from.
Advertisements

Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
Java security (in a nutshell)
Lakshmi Narayana Gupta Kollepara 10/26/2009 CSC-8320.
Exceptions Don’t Frustrate Your User – Handle Errors KR – CS 1401 Spring 2005 Picture – sysprog.net.
Exception Handling Chapter 15 2 What You Will Learn Use try, throw, catch to watch for indicate exceptions handle How to process exceptions and failures.
1 Lecture 11 Interfaces and Exception Handling from Chapters 9 and 10.
6/10/2015C++ for Java Programmers1 Pointers and References Timothy Budd.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Slides prepared by Rose Williams, Binghamton University Chapter 9 Exception Handling.
Confined Types Encapsulation and modularity Seminar November, 2005 presented by: Guy Gueta.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Interfaces. In this class, we will cover: What an interface is Why you would use an interface Creating an interface Using an interface Cloning an object.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
The environment of the computation Declarations introduce names that denote entities. At execution-time, entities are bound to values or to locations:
Slides prepared by Rose Williams, Binghamton University Chapter 9 More Exception Handling.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CS-550 (M.Soneru): Protection and Security - 2 [SaS] 1 Protection and Security - 2.
Exceptions. Many problems in code are handled when the code is compiled, but not all Some are impossible to catch before the program is run  Must run.
Proxy Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
Java Methods By J. W. Rider. Java Methods Modularity Declaring methods –Header, signature, prototype Static Void Local variables –this Return Reentrancy.
OOP Languages: Java vs C++
Inheritance One of the biggest advantages of object-oriented design is that of inheritance. A class may be derived from another class, the base class.
(c) University of Washingtonhashing-1 CSC 143 Java Hashing Set Implementation via Hashing.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Programming Languages and Paradigms Object-Oriented Programming.
Chapter 16 – DNS. DNS Domain Name Service This service allows client machines to resolve computer names (domain names) to IP addresses DNS works at the.
“is a”  Define a new class DerivedClass which extends BaseClass class BaseClass { // class contents } class DerivedClass : BaseClass { // class.
June 14, 2001Exception Handling in Java1 Richard S. Huntrods June 14, 2001 University of Calgary.
Slides prepared by Rose Williams, Binghamton University ICS201 Lecture 9 : Exception Handling King Fahd University of Petroleum & Minerals College of Computer.
Chapter 12 Inheritance and Exceptions Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas,
Object Oriented Programming
CISC6795: Spring Object-Oriented Programming: Polymorphism.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
CS Sept CACL: Efficient Fine­Grained Protection for Objects Richardson, Schwarz, Cabrera IBM Almaden OOPSLA’92.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
Exceptions Handling Exceptionally Sticky Problems.
More About Classes Ranga Rodrigo. Information hiding. Copying objects.
Chapter 18 Java Collections Framework
RIT Computer Science Dept. Goals l Inheritance l Modifiers: private, public, protected l Polymorphism.
Exceptions in Java. Exceptions An exception is an object describing an unusual or erroneous situation Exceptions are thrown by a program, and may be caught.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
Design Patterns David Talby. This Lecture Re-routing method calls Chain of Responsibility Coding partial algorithms Template Method The Singleton Pattern.
Final Review. From ArrayLists to Arrays The ArrayList : used to organize a list of objects –It is a class in the Java API –the ArrayList class uses an.
Exception Handling in Java Topics: Introduction Errors and Error handling Exceptions Types of Exceptions Coding Exceptions Summary.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 10 Java Fundamentals Objects/ClassesMethods.
OOP Tirgul 7. What We’ll Be Seeing Today  Packages  Exceptions  Ex4 2.
Eighth Lecture Exception Handling in Java
Chapter 14: System Protection
Handling Exceptionally Sticky Problems
Tirgul 13 Exceptions 1.
Java Primer 1: Types, Classes and Operators
Java security (in a nutshell)
Topic: Java Security Models
Pointers and References
Java Programming Language
Handling Exceptionally Sticky Problems
Exception Handling.
SPL – PS3 C++ Classes.
Java Chapter 5 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

An Approach to Safe Object Sharing Ciaran Bryce & Chrislain Razafimahefa University of Geneva, Switzerland

Goal  Need to isolate mistrusting programs from one another and protect host platforms  We still want object pointer alias for performance reason (call-by-value is too costly for argument that contains large objects)

Some available solutions (1)  Java’s loader model Mistrusting programs in distinct loader spaces can only communicate with each other through serialization. It’s slow! Shared system classes are potentially dangerous

Some available solutions (2)  Guarded object Guard object check permission before giving out reference of the guarded object No way to protect against errors in the guard object’s code Once the reference is given out, it can not be easily revoked

Some available solutions (3)  Class-based alias control techniques Different instances of the class might have different security policy but are treated uniformly in this approach Can only enforce static security constraints

Object Space Model  Each object belongs to a space  An access matrix determines whether a space has right to access another space  The access matrix could be updated by “grant” and “revoke” operations  Objects in different spaces might “name” each other, but access right is checked upon method invocation

The Space Hierachy  Tree structure with a “RootSpace”, and each space can create child spaces, every object is created in one particular space Root S4S3 S2 S1

Access Rights among spaces  Default: parent has access to its child spaces, and a space has access to itself  Granting rights: a parent can grant any space the rights to its children a parent can also grant right it has to its children spaces  Revoking rights a parent can revoke rights to its children from any spaces a parent can also revoke rights that its children had revoke has chain effect to the descendants

Examples – Program Isolation Root client2 server client1

Examples – Guarded Objects Root Guard client G-Obj Traditional guarded object Root Guard client G-Obj Java guard object

Examples–Server Containment Root user2 server user1 packet Root user2 server user1 packet Server’s right to packet is revoked by user1 after service

Implementation - API  IOSObject – contains a pointer to the space the object belongs to  Space – implements operations, such as createChildSpace, grant, revoke, newInstance and checkAccess  RemoteSpace – prevents leaking handle for a space to objects in different spaces

Implementation - Bridge  Surprise, surprise, if we can “name” objects from different space, how do we guarantee that every method invocation on an object will do proper security check? Answer is a level of indirection through bridge objects  Objects that are referred cross-space are actually bridge objects. The bridge objects are transparent to programmers.

When are the bridge objects used?  When parent space creates an object in its child space, it gets a bridge object handle (newInstance)  When a method call has argument objects from different spaces, they are transferred to bridge objects before passed into the method  When a method returns an object, the result needs to be transferred to a bridge object  Exceptions are caught and arguments are transferred to proper bridge object

Implementing Bridge Class  Every class C has a Bridge class Bc < C  Every object gets a bridge object for every outside space that refers to it. The bridge object contains pointers to the protected object and its space, as well as the space that is using the object  Bc insures the following for every method in C: Perform security checks using the access matrix Convert arguments and result to proper bridge objects Catch exceptions and convert the argument to proper bridge objects

Bridge Objects Space 1 Space 2 Space 3 O1 O2 O3 O5 O4

Problems: final and private clauses / system classes  Bridge class Bc is a subclass of C, so the object space program either has to reject classes that contain final or pirvate clauses, or has to remove the modifiers from class files before linking  Some system classes, i.e., Object, String, Integer etc., contain final methods. They need special treatment

Problems: field access  Field access to the object in a different space is actually field of the bridge object which does not contain anything  One solution is to convert field access to method calls

Problems : static methods and fields / native methods  Static methods and fields are security holes. There is no way to rewrite to provide a level of indirection  No guarantee on the behavior of native methods  Reject both

Problems : arrays  Element selection “[]” is not a method call  Make local copies when array object is referred across a space boundary  Each element in the array is modified to be the proper bridge object  To share an array, wrap it in a class that has entry selectors as methods

Problems : Synchronization  synchronized statement will mistakenly synchronize on bridge objects instead of the original objects  synchronized methods invocation will be directed to the original object through the bridge object

Performance evaluation  More efficient than copy-by-value model, especially when the size of object used across domain boundary is large  Some cost for creating bridge classes and loading them

Related work  Java’s loader mechanism  Capability object in J-Kernel  JavaSeal  Real-time Java  SecurityManager  Jflow  Alias control

Discussion  Is the tree-like space hierarchy natural to programmers?  Do you like the idea of everything being checked dynamically? “Your program compiles, but you have to run it to see if it works.”  How to describe the set of security policy that could be enforced in this model?  Loading bridge classes is insecure and inefficient