Link-Time Enforcement of Confined Types for JVM Bytecode
Philip W. L. Fong
pwlfong@cs.uregina.ca
Department of Computer Science University of Regina Regina, Saskatchewan, Canada
Link-Time Enforcement of Confined Types for JVM Bytecode Philip W. - - PowerPoint PPT Presentation
Link-Time Enforcement of Confined Types for JVM Bytecode Philip W. L. Fong pwlfong@cs.uregina.ca Department of Computer Science University of Regina Regina, Saskatchewan, Canada Overview Motivation Confined Types A Bytecode-level
Philip W. L. Fong
pwlfong@cs.uregina.ca
Department of Computer Science University of Regina Regina, Saskatchewan, Canada
Link-Time Enforcement of Confined Types for JVM Bytecode – p.1/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.2/33
Process P Process C Code Producer Code Consumer R
Link-Time Enforcement of Confined Types for JVM Bytecode – p.3/33
E Program Fragment
Code Consumer Process P Process C R Code Producer
Link-Time Enforcement of Confined Types for JVM Bytecode – p.4/33
Program Fragment E
R Code Producer Code Consumer Process P Process C
Link-Time Enforcement of Confined Types for JVM Bytecode – p.5/33
Program Fragment E
R Code Producer Code Consumer Process P Process C
Examples:
Link-Time Enforcement of Confined Types for JVM Bytecode – p.6/33
Language-based Security:
Link-Time Enforcement of Confined Types for JVM Bytecode – p.7/33
Data Encapsulation
Reference Encapsulation
Link-Time Enforcement of Confined Types for JVM Bytecode – p.8/33
Confined Types (Vitek et al 2001, 2003)
Link-Time Enforcement of Confined Types for JVM Bytecode – p.9/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.10/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.11/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.12/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.13/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.14/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.15/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.16/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.17/33
Capability Types (Boyland et al 2001):
Link-Time Enforcement of Confined Types for JVM Bytecode – p.18/33
A Capability-based Formulation of Confined Types:
Link-Time Enforcement of Confined Types for JVM Bytecode – p.19/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.20/33
invokevirtual B.m Operand Stack:
Operation: Invoke method B.m on object instance o,
Type Constraints:
Link-Time Enforcement of Confined Types for JVM Bytecode – p.21/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.22/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.23/33
Type Annotations Frontend javac Backend Link−Time Type Checker Annotated Java Source Java Source Internet Annotated Classfile JVM Classfile
Implementation Experiences:
Link-Time Enforcement of Confined Types for JVM Bytecode – p.24/33
Aegis VM
PVM-based Implementation of Confined Types
Link-Time Enforcement of Confined Types for JVM Bytecode – p.25/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.26/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.27/33
Problem: Alice wants to share a Recourse with Bob, but worries that the sharing leads to resource leaking . . . package domain; confined class Resource { ... } public class Alice { static Resource resource = new Resource(); public static void main(String[] args) throws Throwable { Class C = Class.forName(args[0]); Bob b = (Bob) C.newInstance(); b.share(resource); } } public interface Bob { void share(Resource r); }
Link-Time Enforcement of Confined Types for JVM Bytecode – p.28/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.29/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.30/33
Consequence: PVM fails to confirm compliance of
Consequence: Intermodular type checking will fail.
Link-Time Enforcement of Confined Types for JVM Bytecode – p.31/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.32/33
Link-Time Enforcement of Confined Types for JVM Bytecode – p.33/33