90 likes | 175 Vues
Team meeting Sept 22, 2011. Christophe Foket. Context. Developer. Attacker. Class hierarchy flattening. Developer. Attacker. Class hierarchy flattening.
E N D
Team meetingSept 22, 2011 ChristopheFoket
Context Developer Attacker
Classhierarchyflattening Developer Attacker
Classhierarchyflattening AbstractWindow window = new ShapeWindow(...);Circle circle1 = new Circle(...);Rectangle rectangle1 = new Rectangle(...);...Circle circle2 = new Circle(...);Rectangle rectangle2 = new Rectangle(...); … window. add(circle1); window. add(rectangle1); window. add(circle2); window. add(rectangle2); Less type information? Obfuscatable window = new ShapeWindow(...);Obfuscatable circle1 = new Circle(...);Obfuscatable rectangle1 = new Rectangle(...);...Obfuscatable circle2 = new Circle(...);Obfuscatable rectangle2 = new Rectangle(...); … window. add(circle1); window. add(rectangle1); window. add(circle2); window. add(rectangle2);
Classhierarchyflattening Usepoints-toanalysis: average points-to set per localvariable, calculatedwithPaddle (soot)no extra casts wereinsertedthatwouldgiveaway type information (around 500 with SPARK)
Points-to set reduction public class A implements I { public void m(){} } this(A:m) -> {A} public class B implements I{ public void m(){} } this(B:m) -> {B} public class A { public void m(){} } this(A:m) -> {A,B} public class B extends A{} Total # locals: 1 Total # types: 2 Average = 2/1 = 2 Total # locals: 2 Total # types: 2 Average = 2/2 = 1
Solution: static methods public class A implements I {} public class B implements I {} public class S { public static m(I i){} } this(I:m) -> {A,B} public class A { public void m(){} } this(A:m) -> {A,B} public class B extends A{} Total # locals: 1 Total # types: 2 Average = 2/1 = 2 Total # locals: 1 Total # types: 2 Average = 2/1 = 2
Solution: static methods Points-to set sizes: Notsame as originalbecause we cannotmake all methodsthatneed to becopied static.
Schedule • randomlyinsert “free” classes in the hierarchy • continue evaluationusing Stigmata • continue writing paper (onhold)