symbolic execution of debian packages
play

Symbolic Execution of Debian Packages Nicolas Jeannerod - PowerPoint PPT Presentation

Symbolic Execution of Debian Packages Nicolas Jeannerod nicolas.jeannerod@irif.fr joint work with Benedikt Becker, Claude March Yann Rgis-Gianas, Mihaela Sighireanu, Ralf Treinen IRIF, Universit de Paris September 9, 2019 13th Alpine


  1. Symbolic Execution of Debian Packages Nicolas Jeannerod nicolas.jeannerod@irif.fr joint work with Benedikt Becker, Claude Marché Yann Régis-Gianas, Mihaela Sighireanu, Ralf Treinen IRIF, Université de Paris September 9, 2019 13th Alpine Verification Meeting

  2. Introduction > CoLiS project: Correctness of Linux Scripts 1

  3. Introduction > CoLiS project: Correctness of Linux Scripts > Goal: applying formal methods to the quality assessment of Debian Packages. 1

  4. Introduction > CoLiS project: Correctness of Linux Scripts > Goal: applying formal methods to the quality assessment of Debian Packages. > Debian: operating system. > Packages: way to provide (install, update, remove) software. 1

  5. Introduction > CoLiS project: Correctness of Linux Scripts > Goal: applying formal methods to the quality assessment of Debian Packages. > Debian: operating system. > Packages: way to provide (install, update, remove) software. > Goal (reformulated): making sure that installing/updating/removing software does not: > make other softwares unusable, > make the whole computer unusable, > remove your personnal files, > etc. 1

  6. Installing a Software on Debian 1. Download the package. 2

  7. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. 2

  8. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. 3. Unpack static archive. 2

  9. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. 3. Unpack static archive. 4. Execute a post-installation script. 2

  10. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. > This is a POSIX shell script ran as administrator. 3. Unpack static archive. 4. Execute a post-installation script. > This is a POSIX shell script ran as administrator. 2

  11. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. > This is a POSIX shell script ran as administrator. 3. Unpack static archive. 4. Execute a post-installation script. > This is a POSIX shell script ran as administrator. POSIX shell: > scripting language 2

  12. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. > This is a POSIX shell script ran as administrator. 3. Unpack static archive. 4. Execute a post-installation script. > This is a POSIX shell script ran as administrator. POSIX shell: > scripting language > legacy (born in 1971) 2

  13. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. > This is a POSIX shell script ran as administrator. 3. Unpack static archive. 4. Execute a post-installation script. > This is a POSIX shell script ran as administrator. POSIX shell: Administrator: > scripting language > can do anything on the system > legacy (born in 1971) 2

  14. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. > This is a POSIX shell script ran as administrator. 3. Unpack static archive. 4. Execute a post-installation script. > This is a POSIX shell script ran as administrator. POSIX shell: Administrator: > scripting language > can do anything on the system > legacy (born in 1971) Complicated and dangerous 2

  15. Installing a Software on Debian 1. Download the package. 2. Execute a pre-installation script. > This is a POSIX shell script ran as administrator. 3. Unpack static archive. 4. Execute a post-installation script. > This is a POSIX shell script ran as administrator. POSIX shell: Administrator: > scripting language > can do anything on the system > legacy (born in 1971) Complicated and dangerous. Formal methods? 2

  16. Our Tools: An Overview Debian Package CoLiS Report 3

  17. Our Tools: An Overview Debian Package Shell script Specification Symbolic CoLiS of the script Engine Report 3

  18. Our Tools: An Overview Debian Morbig, Morsmall Package and ColisFromShell t p i r c Colis s l l inter. e h S language Specification Symbolic CoLiS of the script Engine Report 3

  19. Our Tools: An Overview Debian Morbig, Morsmall Package and ColisFromShell t p i r c Colis s l l inter. e h S language Specification Symbolic Specifications CoLiS of the script Engine of commands Report 3

  20. Our Tools: An Overview Debian Morbig, Morsmall Package and ColisFromShell t p i r c Colis s l l inter. e h S language Specification Symbolic Specifications CoLiS of the script Engine of commands SAT? SAT solver for specifications Report 3

  21. Our Tools: An Overview Debian   Régis-Gianas, Morbig, Morsmall J & Treinen Package   and ColisFromShell SLE 2018 t p i r c Colis s   J, Marché l l inter. & Treinen e h   S VSTTE 2017 language Specification Symbolic Specifications CoLiS of the script Engine of commands SAT? SAT solver for specifications Report 3

  22. Specifications, Feature Trees & Constraints

  23. Feature Trees g g f h f h g f > Unranked unordered trees; 4

  24. Feature Trees g g f h f h g f > Unranked unordered trees; > Good models for the UNIX filesystem; 4

  25. Feature Trees g g f h f h g f > Unranked unordered trees; > Good models for the UNIX filesystem; > Shell scripts can be seen as programs that modify such trees; 4

  26. Feature Trees g g f h f h g f > Unranked unordered trees; > Good models for the UNIX filesystem; > Shell scripts can be seen as programs that modify such trees; > Constraints will express relations between such trees. 4

  27. Constraints On Feature Trees Atom (Informal) Semantics 5

  28. Constraints On Feature Trees Atom (Informal) Semantics x [ f ] y From x ’s tree, through f , we go to y ’s tree   Aït-Kaci x [ f ] ↑ In x ’s tree, there is no f Podelski     & Smolka   Ax The root of x ’s tree has decoration A 1992 5

  29. Constraints On Feature Trees Atom (Informal) Semantics x [ f ] y From x ’s tree, through f , we go to y ’s tree   Aït-Kaci x [ f ] ↑ In x ’s tree, there is no f Podelski     & Smolka   Ax The root of x ’s tree has decoration A 1992   Smolka x [ F ] x ’s tree can also use features in F & Treinen   1994 5

  30. Constraints On Feature Trees Atom (Informal) Semantics x [ f ] y From x ’s tree, through f , we go to y ’s tree   Aït-Kaci x [ f ] ↑ In x ’s tree, there is no f Podelski     & Smolka   Ax The root of x ’s tree has decoration A 1992   Smolka x [ F ] x ’s tree can also use features in F & Treinen   1994 x ∼ F y x and y ’s trees are similar except in F 5

  31. Example Specification: mkdir q/f ∃ x , x ′ , y ′ · resolve ( r , cwd , q , x ) ∧ dir ( x ) ∧ x [ f ] ↑ Success ∧ similar ( r , r ′ , cwd , q , x , x ′ ) ∧ x ∼ { f } x ′ ∧ dir ( x ′ ) ∧ x ′ [ f ] y ′ ∧ dir ( y ′ ) ∧ y ′ [ ∅ ] ∃ y · resolve ( r , cwd , q / f , y ) ∧ r . = r ′ noresolve ( r , cwd , q ) ∧ r . = r ′ Error ∃ x · resolve ( r , cwd , q , x ) ∧¬ dir ( x ) ∧ r . = r ′ 6

  32. Example Specification: mkdir q/f ∃ x , x ′ , y ′ · resolve ( r , cwd , q , x ) ∧ dir ( x ) ∧ x [ f ] ↑ Success ∧ similar ( r , r ′ , cwd , q , x , x ′ ) ∧ x ∼ { f } x ′ ∧ dir ( x ′ ) ∧ x ′ [ f ] y ′ ∧ dir ( y ′ ) ∧ y ′ [ ∅ ] ∃ y · resolve ( r , cwd , q / f , y ) ∧ r . = r ′ noresolve ( r , cwd , q ) ∧ r . = r ′ Error ∃ x · resolve ( r , cwd , q , x ) ∧¬ dir ( x ) ∧ r . = r ′ 6

  33. Example Specification: mkdir q/f ∃ x , x ′ , y ′ · resolve ( r , cwd , q , x ) ∧ dir ( x ) ∧ x [ f ] ↑ Success ∧ similar ( r , r ′ , cwd , q , x , x ′ ) ∧ x ∼ { f } x ′ ∧ dir ( x ′ ) ∧ x ′ [ f ] y ′ ∧ dir ( y ′ ) ∧ y ′ [ ∅ ] r ∃ y · resolve ( r , cwd , q / f , y ) ∧ r . = r ′ q ∃ x noresolve ( r , cwd , q ) ∧ r . = r ′ Error ∃ x · resolve ( r , cwd , q , x ) ∧¬ dir ( x ) ∧ r . = r ′ 6

  34. Example Specification: mkdir q/f ∃ x , x ′ , y ′ · resolve ( r , cwd , q , x ) ∧ dir ( x ) ∧ x [ f ] ↑ Success ∧ similar ( r , r ′ , cwd , q , x , x ′ ) ∧ x ∼ { f } x ′ ∧ dir ( x ′ ) ∧ x ′ [ f ] y ′ ∧ dir ( y ′ ) ∧ y ′ [ ∅ ] r ∃ y · resolve ( r , cwd , q / f , y ) ∧ r . = r ′ q ∃ x noresolve ( r , cwd , q ) ∧ r . = r ′ (dir) Error ∃ x · resolve ( r , cwd , q , x ) ∧¬ dir ( x ) ∧ r . = r ′ 6

  35. Example Specification: mkdir q/f ∃ x , x ′ , y ′ · resolve ( r , cwd , q , x ) ∧ dir ( x ) ∧ x [ f ] ↑ Success ∧ similar ( r , r ′ , cwd , q , x , x ′ ) ∧ x ∼ { f } x ′ ∧ dir ( x ′ ) ∧ x ′ [ f ] y ′ ∧ dir ( y ′ ) ∧ y ′ [ ∅ ] r ∃ y · resolve ( r , cwd , q / f , y ) ∧ r . = r ′ q ∃ x noresolve ( r , cwd , q ) ∧ r . = r ′ (dir) Error f ∃ x · resolve ( r , cwd , q , x ) ∧¬ dir ( x ) ∧ r . ⊥ = r ′ 6

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