t ype g uided w orst c ase i nput g eneration di wang jan
play

T YPE -G UIDED W ORST -C ASE I NPUT G ENERATION Di Wang , Jan - PowerPoint PPT Presentation

T YPE -G UIDED W ORST -C ASE I NPUT G ENERATION Di Wang , Jan Hoffmann Carnegie Mellon University R ESOURCE A NALYSIS Programs 2 R ESOURCE A NALYSIS Programs Performance 2 R ESOURCE A NALYSIS Time Memory Power Programs Performance


  1. λ T YPE -G UIDED W ORST -C ASE I NPUT G ENERATION Di Wang , Jan Hoffmann Carnegie Mellon University

  2. R ESOURCE A NALYSIS Programs 2

  3. R ESOURCE A NALYSIS Programs Performance 2

  4. R ESOURCE A NALYSIS Time Memory Power … Programs Performance 2

  5. R ESOURCE A NALYSIS Performance bottlenecks Worst-Case Algorithmic complexity Analysis Time vulnerabilities Memory Power … Timing side channels Programs Performance 2

  6. E XAMPLE OF W ORST -C ASE A NALYSIS PHP 1 CVE - CVE-2011-4885. Available on: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4885. 2 PHP 5.3.8 - Hashtables Denial of Service. Available on https://www.exploit-db.com/exploits/18296/. 3 PHP: PHP 5 ChangeLog. Available on http://www.php.net/ChangeLog-5.php#5.3.9. 3

  7. E XAMPLE OF W ORST -C ASE A NALYSIS Potential Denial-of-Service attack 1 PHP 1 CVE - CVE-2011-4885. Available on: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4885. 2 PHP 5.3.8 - Hashtables Denial of Service. Available on https://www.exploit-db.com/exploits/18296/. 3 PHP: PHP 5 ChangeLog. Available on http://www.php.net/ChangeLog-5.php#5.3.9. 3

  8. E XAMPLE OF W ORST -C ASE A NALYSIS Potential Denial-of-Service attack 1 PHP Concrete exploits (by hash collisions) 2 1 CVE - CVE-2011-4885. Available on: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4885. 2 PHP 5.3.8 - Hashtables Denial of Service. Available on https://www.exploit-db.com/exploits/18296/. 3 PHP: PHP 5 ChangeLog. Available on http://www.php.net/ChangeLog-5.php#5.3.9. 3

  9. E XAMPLE OF W ORST -C ASE A NALYSIS Potential Denial-of-Service attack 1 PHP Bug fixed! 3 Concrete exploits (by hash collisions) 2 1 CVE - CVE-2011-4885. Available on: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4885. 2 PHP 5.3.8 - Hashtables Denial of Service. Available on https://www.exploit-db.com/exploits/18296/. 3 PHP: PHP 5 ChangeLog. Available on http://www.php.net/ChangeLog-5.php#5.3.9. 3

  10. E XAMPLE OF W ORST -C ASE A NALYSIS Potential Denial-of-Service attack 1 Worst-case inputs are instrumental to PHP understand and fix performance bugs! Bug fixed! 3 Concrete exploits (by hash collisions) 2 1 CVE - CVE-2011-4885. Available on: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4885. 2 PHP 5.3.8 - Hashtables Denial of Service. Available on https://www.exploit-db.com/exploits/18296/. 3 PHP: PHP 5 ChangeLog. Available on http://www.php.net/ChangeLog-5.php#5.3.9. 3

  11. E XISTING A PPROACHES 4

  12. E XISTING A PPROACHES Dynamic Fuzz testing Symbolic execution Dynamic worst-case analysis … Flexible & universal Potentially unsound: The resulting inputs might not expose the worst-case behavior. 4

  13. E XISTING A PPROACHES Dynamic Static Fuzz testing Type systems Symbolic execution Abstract interpretation Dynamic worst-case analysis … … Sound upper bounds Flexible & universal Potentially not tight: No concrete Potentially unsound: The resulting witness — the bound might be inputs might not expose the too conservative. worst-case behavior. 4

  14. C ONTRIBUTIONS A type-guided worst-case input generation algorithm Proof of soundness and relative completeness Heuristics to improve scalability 5

  15. C ONTRIBUTIONS A type-guided worst-case input generation algorithm Proof of soundness and relative completeness Heuristics to improve scalability λ 5

  16. C ONTRIBUTIONS A type-guided worst-case input generation algorithm Proof of soundness and relative completeness Heuristics to improve scalability λ Resource Aware ML (RaML) 5

  17. C ONTRIBUTIONS A type-guided worst-case input generation algorithm Proof of soundness and relative completeness Heuristics to improve scalability λ Resource Aware ML (RaML) 5

  18. C ONTRIBUTIONS A type-guided worst-case input generation algorithm Proof of soundness and relative completeness Heuristics to improve scalability λ Resource Aware ML (RaML) Symbolic Execution 5

  19. C ONTRIBUTIONS A type-guided worst-case input generation algorithm Proof of soundness and relative completeness Heuristics to improve scalability λ Resource Aware ML (RaML) Guide Symbolic Execution 5

  20. O VERVIEW Motivation Resource Aware ML (RaML) Type-Guided Worst-Case Input Generation Evaluation 6

  21. A MORTIZED R ESOURCE A NALYSIS The potential method 7

  22. A MORTIZED R ESOURCE A NALYSIS The potential method D 4 D 5 … … D 0 D 1 D 2 D 3 D n 7

  23. A MORTIZED R ESOURCE A NALYSIS D i ’s are program states The potential method D 4 D 5 … … D 0 D 1 D 2 D 3 D n 7

  24. A MORTIZED R ESOURCE A NALYSIS D i ’s are program states Arrows are transitions The potential method with actual costs D 4 D 5 … … D 0 D 1 D 2 D 3 D n 7

  25. A MORTIZED R ESOURCE A NALYSIS D i ’s are program states Arrows are transitions The potential method with actual costs D 4 D 5 … … D 0 D 1 D 2 D 3 D n Φ ( D 0 ) Φ ( D 1 ) Φ ( D 2 ) Φ ( D 3 ) Φ ( D n ) 7

  26. A MORTIZED R ESOURCE A NALYSIS D i ’s are program states Arrows are transitions The potential method with actual costs D 4 D 5 … … D 0 D 1 D 2 D 3 D n Φ ( D 0 ) Φ ( D 1 ) Φ ( D 2 ) Φ ( D 3 ) Φ ( D n ) The potential function maps program states to nonnegative numbers 7

  27. A MORTIZED R ESOURCE A NALYSIS D i ’s are program states Arrows are transitions The potential method with actual costs D 4 D 5 … … D 0 D 1 D 2 D 3 D n Φ ( D 0 ) Φ ( D 1 ) Φ ( D 2 ) Φ ( D 3 ) Φ ( D n ) The potential function Φ ( D 2 ) ≥ Cost ( D 2 , D 3 ) + Φ ( D 3 ) maps program states to nonnegative numbers 7

  28. A MORTIZED R ESOURCE A NALYSIS D i ’s are program states Arrows are transitions The potential method with actual costs D 4 D 5 … … D 0 D 1 D 2 D 3 D n Φ ( D 0 ) Φ ( D 1 ) Φ ( D 2 ) Φ ( D 3 ) Φ ( D n ) The potential function Φ ( D 2 ) ≥ Cost ( D 2 , D 3 ) + Φ ( D 3 ) The initial potential is an maps program states to upper bound! nonnegative numbers 7

  29. T YPE -B ASED A NALYSIS The potential at a let rec lpairs l = program point is defined match l with | [] -> [] by a static annotation of | x1 :: xs -> match xs with data structures. | [] -> [] | x2 :: xs ’ -> A list of length n annotated if ( x1 : int ) < ( x2 : int ) then ( x1 , x2 ) :: lpairs xs ’ with a nonnegative number else lpairs xs ’ q has q·n units of potential. 8

  30. T YPE -B ASED A NALYSIS The potential at a let rec lpairs l = program point is defined match l with | [] -> [] by a static annotation of | x1 :: xs -> match xs with data structures. | [] -> [] | x2 :: xs ’ -> A list of length n annotated if ( x1 : int ) < ( x2 : int ) then ( x1 , x2 ) :: lpairs xs ’ with a nonnegative number else lpairs xs ’ q has q·n units of potential. Each of [] , :: , (,) consumes 2 memory cells. 8

  31. T YPE -B ASED A NALYSIS Cost = 2 ⋅ | ℓ | + 2 The potential at a let rec lpairs l = program point is defined match l with | [] -> [] by a static annotation of | x1 :: xs -> match xs with data structures. | [] -> [] | x2 :: xs ’ -> A list of length n annotated if ( x1 : int ) < ( x2 : int ) then ( x1 , x2 ) :: lpairs xs ’ with a nonnegative number else lpairs xs ’ q has q·n units of potential. Each of [] , :: , (,) consumes 2 memory cells. 8

  32. T YPE -B ASED A NALYSIS L 2 ( 𝗃𝗈𝗎 ) 2/0 L 0 ( 𝗃𝗈𝗎 × 𝗃𝗈𝗎 ) The potential at a let rec lpairs l = program point is defined match l with | [] -> [] by a static annotation of | x1 :: xs -> match xs with data structures. | [] -> [] | x2 :: xs ’ -> A list of length n annotated if ( x1 : int ) < ( x2 : int ) then ( x1 , x2 ) :: lpairs xs ’ with a nonnegative number else lpairs xs ’ q has q·n units of potential. Each of [] , :: , (,) consumes 2 memory cells. 8

  33. T YPE -B ASED A NALYSIS L 2 ( 𝗃𝗈𝗎 ) 2/0 L 0 ( 𝗃𝗈𝗎 × 𝗃𝗈𝗎 ) The potential at a let rec lpairs l = Φ 0 = 2 ⋅ | ℓ | + 2 program point is defined match l with | [] -> [] by a static annotation of | x1 :: xs -> match xs with data structures. | [] -> [] | x2 :: xs ’ -> A list of length n annotated if ( x1 : int ) < ( x2 : int ) then ( x1 , x2 ) :: lpairs xs ’ with a nonnegative number else lpairs xs ’ q has q·n units of potential. Each of [] , :: , (,) consumes 2 memory cells. 8

  34. T YPE -B ASED A NALYSIS L 2 ( 𝗃𝗈𝗎 ) 2/0 L 0 ( 𝗃𝗈𝗎 × 𝗃𝗈𝗎 ) The potential at a let rec lpairs l = Φ 0 = 2 ⋅ | ℓ | + 2 program point is defined match l with | [] -> [] Cost = 2 by a static annotation of | x1 :: xs -> match xs with data structures. | [] -> [] | x2 :: xs ’ -> A list of length n annotated if ( x1 : int ) < ( x2 : int ) then ( x1 , x2 ) :: lpairs xs ’ with a nonnegative number else lpairs xs ’ q has q·n units of potential. Each of [] , :: , (,) consumes 2 memory cells. 8

  35. T YPE -B ASED A NALYSIS L 2 ( 𝗃𝗈𝗎 ) 2/0 L 0 ( 𝗃𝗈𝗎 × 𝗃𝗈𝗎 ) The potential at a let rec lpairs l = program point is defined match l with | [] -> [] by a static annotation of | x1 :: xs -> Φ 1 = 2 ⋅ | xs | + 4 match xs with data structures. | [] -> [] | x2 :: xs ’ -> A list of length n annotated if ( x1 : int ) < ( x2 : int ) then ( x1 , x2 ) :: lpairs xs ’ with a nonnegative number else lpairs xs ’ q has q·n units of potential. Each of [] , :: , (,) consumes 2 memory cells. 8

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend