cross architecture li er synthesis
play

Cross-Architecture Li/er Synthesis Rijnard van Tonder and - PowerPoint PPT Presentation

Cross-Architecture Li/er Synthesis Rijnard van Tonder and Claire Le Goues Cross-Architecture Li/er Synthesis Rijnard van Tonder and Claire Le Goues


  1. Cross-­‑Architecture ¡Li/er ¡Synthesis ¡ Rijnard ¡van ¡Tonder ¡and ¡Claire ¡Le ¡Goues ¡ ¡ ¡

  2. Cross-­‑Architecture ¡Li/er ¡Synthesis ¡ Rijnard ¡van ¡Tonder ¡and ¡Claire ¡Le ¡Goues ¡ ¡ ¡

  3. What ¡is ¡a ¡Li/er? ¡ 3 ¡

  4. What ¡is ¡a ¡Li/er? ¡ x86 ¡ ARM ¡ … ¡ Lower ¡level ¡code ¡ 4 ¡

  5. What ¡is ¡a ¡Li/er? ¡ x86 ¡ ARM ¡ … ¡ Lower ¡level ¡code ¡ Architecture-­‑speci3ic ¡ 5 ¡

  6. What ¡is ¡a ¡Li/er? ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ 6 ¡

  7. What ¡is ¡a ¡Li/er? ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ Higher ¡level ¡code ¡ 7 ¡

  8. What ¡is ¡a ¡Li/er? ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ Higher ¡level ¡code ¡ Architecture-­‑agnostic ¡ 8 ¡

  9. Why ¡Li/ers? ¡ 9 ¡

  10. Why ¡Li/ers? ¡ • Binary ¡analysis ¡ 10 ¡

  11. Why ¡Li/ers? ¡ • Binary ¡analysis ¡ • Simpler ¡semantic ¡abstraction ¡ – E.g., ¡symbolic ¡execution ¡ 11 ¡

  12. Why ¡Li/ers? ¡ • Binary ¡analysis ¡ • Simpler ¡semantic ¡abstraction ¡ – E.g., ¡symbolic ¡execution ¡ • Reuse ¡analysis ¡components ¡ – Control ¡3low ¡graph ¡construction ¡ – Single ¡Static ¡Assignment ¡(SSA) ¡conversion ¡ 12 ¡

  13. Compilers ¡and ¡Decompilers ¡ • Compilers ¡lose ¡information ¡ – Translation ¡is ¡not ¡a ¡bijection ¡ ¡ 13 ¡

  14. Compilers ¡and ¡Decompilers ¡ • Compilers ¡lose ¡information ¡ – Translation ¡is ¡not ¡a ¡bijection ¡ • Decompilers ¡recover ¡more ¡features ¡ – Often ¡architecture-­‑speci3ic ¡(e.g., ¡ABI) ¡ 14 ¡

  15. The ¡Problem: ¡ Transla?ng ¡Mul?ple ¡Architectures ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ Manual ¡ 15 ¡

  16. The ¡Problem: ¡ Transla?ng ¡Mul?ple ¡Architectures ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ Manual ¡ 1000s ¡of ¡manual ¡pages ¡ 16 ¡

  17. Our ¡Goal: ¡ Automate ¡across ¡Architectures ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ 17 ¡

  18. Our ¡Goal: ¡ Automate ¡across ¡Architectures ¡ x86 ¡ [1] ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ 18 ¡ [1] ¡Stra@fied ¡synthesis: ¡automa@cally ¡learning ¡the ¡x86-­‑64 ¡instruc@on ¡set. ¡Heule ¡et ¡al. ¡

  19. Our ¡Goal: ¡ Automate ¡across ¡Architectures ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ Cross-­‑Architecture ¡reuse ¡ 19 ¡

  20. Our ¡Goal: ¡ Automate ¡across ¡Architectures ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ Bug-­‑3inding ¡Analyses ¡“for ¡free” ¡ 20 ¡

  21. Our ¡Goal: ¡ Automate ¡across ¡Architectures ¡ x86 ¡ Intermediate ¡ ARM ¡ Representa@on ¡ … ¡ Data3low ¡framework ¡ Bug-­‑3inding ¡Analyses ¡“for ¡free” ¡ VC ¡Generation ¡ Taint ¡analysis ¡ 21 ¡

  22. What ¡We ¡Do ¡ 22 ¡

  23. What ¡We ¡Do ¡ • IR ¡translation ¡as ¡a ¡Syntax-­‑Guided ¡Synthesis ¡ problem ¡ 23 ¡

  24. What ¡We ¡Do ¡ • IR ¡translation ¡as ¡a ¡Syntax-­‑Guided ¡Synthesis ¡ problem ¡ ¡∀x ¡. ¡φ(x, ¡P(x)) ¡ ¡ 24 ¡

  25. What ¡We ¡Do ¡ • IR ¡translation ¡as ¡a ¡Syntax-­‑Guided ¡Synthesis ¡ problem ¡ ¡∀x ¡. ¡φ(x, ¡P(x)) ¡ ¡ ≡ ¡∀x ¡. ¡oracle(x) ¡= ¡P(x) ¡ 25 ¡

  26. What ¡We ¡Do ¡ • IR ¡translation ¡as ¡a ¡Syntax-­‑Guided ¡Synthesis ¡ problem ¡ ¡∀x ¡. ¡φ(x, ¡P(x)) ¡ ¡ ≡ ¡∀x ¡. ¡oracle(x) ¡= ¡P(x) ¡ Correctness ¡speci3ication ¡ 26 ¡

  27. What ¡We ¡Do ¡ • IR ¡translation ¡as ¡a ¡Syntax-­‑Guided ¡Synthesis ¡ problem ¡ ¡∀x ¡. ¡φ(x, ¡P(x)) ¡ ¡ ≡ ¡∀x ¡. ¡oracle(x) ¡= ¡P(x) ¡ Dynamic ¡Input/Output ¡Pairs ¡ 27 ¡

  28. What ¡We ¡Do ¡ • IR ¡translation ¡as ¡a ¡Syntax-­‑Guided ¡Synthesis ¡ problem ¡ ¡∀x ¡. ¡φ(x, ¡P(x)) ¡ ¡ ≡ ¡∀x ¡. ¡oracle(x) ¡= ¡P(x) ¡ Dynamic ¡Input/Output ¡Pairs ¡ IR ¡Sketches ¡ 28 ¡

  29. What ¡We ¡Do ¡ • IR ¡translation ¡as ¡a ¡Syntax-­‑Guided ¡Synthesis ¡ problem ¡ ¡∀x ¡. ¡φ(x, ¡P(x)) ¡ ¡ ≡ ¡∀x ¡. ¡oracle(x) ¡= ¡P(x) ¡ Key ¡Insight: ¡ Learn ¡IR ¡Sketches ¡from ¡ existing ¡Lifter ¡Productions ¡ IR ¡Sketches ¡ 29 ¡

  30. Learning ¡Sketch ¡Templates: ¡Example ¡ 30 ¡

  31. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ add ¡R3, ¡R0 ¡ 31 ¡

  32. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ add ¡R3, ¡R0 ¡ SOURCE ¡ Na?ve ¡Instruc?on ¡ 32 ¡

  33. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ add ¡R3, ¡R0 ¡ SOURCE ¡ Na?ve ¡Instruc?on ¡ Op ¡codes ¡and ¡register ¡names ¡ 33 ¡

  34. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ SOURCE ¡ Na?ve ¡Instruc?on ¡ Manual ¡translation ¡rules ¡ 34 ¡

  35. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ SOURCE ¡ Na?ve ¡Instruc?on ¡ Manual ¡translation ¡rules ¡ Intel ¡x86: ¡1500-­‑page ¡manual ¡ ARM: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡1000-­‑page ¡manual ¡ 35 ¡

  36. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ R3 ¡:= ¡R3 ¡+ ¡R0 ¡ SOURCE ¡ TARGET ¡ IR ¡Instruc?on ¡ Na?ve ¡Instruc?on ¡ 36 ¡

  37. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ R3 ¡:= ¡R3 ¡+ ¡R0 ¡ SOURCE ¡ TARGET ¡ IR ¡Instruc?on ¡ Na?ve ¡Instruc?on ¡ IR ¡with ¡operational ¡semantics ¡ 37 ¡

  38. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ R3 ¡:= ¡R3 ¡+ ¡R0 ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ 38 ¡

  39. Learning ¡Sketch ¡Templates: ¡Example ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ R3 ¡:= ¡R3 ¡+ ¡R0 ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ Create ¡sketches ¡from ¡concrete ¡expressions ¡ 39 ¡

  40. Learning ¡Sketch ¡Templates: ¡Example ¡ • Learn ¡templates ¡from ¡lifter ¡output ¡for ¡a ¡ supported ¡architecture ¡to ¡synthesize ¡one ¡ for ¡an ¡ unsupported ¡architecture ¡ 40 ¡

  41. Learning ¡Sketch ¡Templates: ¡Example ¡ IR ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ R3 ¡:= ¡R3 ¡+ ¡R0 ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ Create ¡sketches ¡from ¡concrete ¡expressions ¡ 41 ¡

  42. Learning ¡Sketch ¡Templates: ¡Example ¡ IR ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ R3 ¡:= ¡R3 ¡+ ¡R0 ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ MIPS ¡ add ¡$1, ¡$2 ¡ 42 ¡

  43. Learning ¡Sketch ¡Templates: ¡Example ¡ IR ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ R3 ¡:= ¡R3 ¡+ ¡R0 ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ MIPS ¡ add ¡$1, ¡$2 ¡ Unsupported ¡ Architecture ¡ 43 ¡

  44. Learning ¡Sketch ¡Templates: ¡Example ¡ IR ¡ ARM ¡ LIFT ¡ add ¡R3, ¡R0 ¡ R3 ¡:= ¡R3 ¡+ ¡R0 ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ MIPS ¡ IR ¡ add ¡$1, ¡$2 ¡ $1 ¡:= ¡$1 ¡+ ¡$2 ¡ Unsupported ¡ Architecture ¡ 44 ¡

  45. Learning ¡Sketch ¡Templates: ¡Example ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ MIPS ¡ IR ¡ add ¡$1, ¡$2 ¡ $1 ¡:= ¡$1 ¡+ ¡$2 ¡ Unsupported ¡ Architecture ¡ 45 ¡

  46. Learning ¡Sketch ¡Templates: ¡Example ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ MIPS ¡ IR ¡ add ¡$1, ¡$2 ¡ $1 ¡:= ¡$1 ¡+ ¡$2 ¡ SYNTHESIS ¡ Unsupported ¡ Architecture ¡ 46 ¡

  47. Learning ¡Sketch ¡Templates: ¡Example ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ MIPS ¡ IR ¡ add ¡$1, ¡$2 ¡ $1 ¡:= ¡$1 ¡+ ¡$2 ¡ SYNTHESIS ¡ Unsupported ¡ I/O ¡from ¡execu@ng ¡ add ¡$1, ¡$2 ¡ Architecture ¡ 47 ¡

  48. Learning ¡Sketch ¡Templates: ¡Example ¡ IR ¡SKETCH ¡ _ ¡:= ¡_ ¡+ ¡_ ¡ MIPS ¡ IR ¡ add ¡$1, ¡$2 ¡ $1 ¡:= ¡$1 ¡+ ¡$2 ¡ SYNTHESIS ¡ Unsupported ¡ I/O ¡from ¡execu@ng ¡ add ¡$1, ¡$2 ¡ Architecture ¡ 48 ¡

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