Inser&ng Inten&onal Bugs for Model Checking Assurance - - PowerPoint PPT Presentation

inser ng inten onal bugs for model checking assurance
SMART_READER_LITE
LIVE PREVIEW

Inser&ng Inten&onal Bugs for Model Checking Assurance - - PowerPoint PPT Presentation

Inser&ng Inten&onal Bugs for Model Checking Assurance Thomas L. Rodeheffer and Ramakrishna Kotla Microso? Research, Silicon Valley The Problem


slide-1
SLIDE 1

Inser&ng ¡Inten&onal ¡Bugs ¡for ¡ Model ¡Checking ¡Assurance ¡

Thomas ¡L. ¡Rodeheffer ¡and ¡ Ramakrishna ¡Kotla ¡ Microso? ¡Research, ¡Silicon ¡Valley ¡

slide-2
SLIDE 2

The ¡Problem ¡

2 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

  • Complicated ¡protocol ¡(“Pasture”) ¡

TPM ¡ Create ¡hidden ¡ decryp&on ¡key ¡ Access ¡key ¡ Revoke ¡key ¡and ¡ generate ¡proof ¡ Decide ¡later ¡ On-­‑line ¡ exchange ¡ Read ¡message ¡ Delete ¡message ¡ without ¡reading ¡

slide-3
SLIDE 3

The ¡Problem ¡

3 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

  • Complicated ¡protocol ¡(“Pasture”) ¡
  • Important ¡safety ¡proper&es ¡

TPM ¡ Create ¡hidden ¡ decryp&on ¡key ¡ Access ¡key ¡ Revoke ¡key ¡and ¡ generate ¡proof ¡ Safety: ¡never ¡both ¡ Decide ¡later ¡ On-­‑line ¡ exchange ¡ Mechanism: ¡ append-­‑only ¡log ¡

  • f ¡decisions ¡
slide-4
SLIDE 4

The ¡Problem ¡

4 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

  • Complicated ¡protocol ¡(“Pasture”) ¡
  • Important ¡safety ¡proper&es ¡
  • Adversarial ¡seSng ¡

TPM ¡ Create ¡hidden ¡ decryp&on ¡key ¡ Access ¡key ¡ Revoke ¡key ¡and ¡ generate ¡proof ¡ Safety: ¡never ¡both ¡ Decide ¡later ¡ On-­‑line ¡ exchange ¡ Mechanism: ¡ append-­‑only ¡log ¡

  • f ¡decisions ¡
slide-5
SLIDE 5

The ¡Solu&on ¡

5 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

  • Complicated ¡protocol ¡(“Pasture”) ¡
  • Important ¡safety ¡proper&es ¡
  • Adversarial ¡seSng ¡
  • Solu&on: ¡Use ¡formal ¡methods ¡ ¡

§ Specifica&on ¡– ¡is ¡it ¡correct? ¡ § Model ¡checking ¡– ¡was ¡it ¡enough? ¡ § Formal ¡proof ¡– ¡too ¡hard? ¡

slide-6
SLIDE 6

What ¡we ¡did ¡for ¡Pasture ¡

6 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

Proof ¡ sketch ¡ TLA+ ¡spec ¡ (19 ¡pp) ¡

state, ¡ac&ons, ¡invariants ¡

Model ¡ checking ¡ results ¡ TLA+ ¡proof ¡ (68 ¡pp) ¡

invariants ¡

Understanding ¡ the ¡results ¡ Iden&cal ¡logic ¡but ¡ tons ¡more ¡detail ¡ Write ¡proof ¡ (2 ¡weeks) ¡ (CPU ¡months) ¡ checked ¡

slide-7
SLIDE 7

Pre_y ¡sure ¡it ¡is ¡correct ¡

7 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

Proof ¡ sketch ¡

slide-8
SLIDE 8

Pre_y ¡sure ¡we ¡covered ¡everything ¡

8 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

Proof ¡ sketch ¡ TLA+ ¡spec ¡ (19 ¡pp) ¡

state, ¡ac&ons, ¡invariants ¡

slide-9
SLIDE 9

Model ¡checking ¡– ¡was ¡it ¡enough? ¡

9 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

Proof ¡ sketch ¡ “no ¡errors ¡found” ¡ ¡

Several ¡CPU ¡months ¡later… ¡

TLA+ ¡spec ¡ (19 ¡pp) ¡

state, ¡ac&ons, ¡invariants ¡

Cannot ¡model ¡check ¡any ¡larger ¡configura&ons ¡using ¡TLC ¡ because ¡such ¡configura&ons ¡have ¡more ¡than ¡232 ¡dis&nct ¡ states ¡– ¡making ¡state ¡fingerprint ¡collision ¡a ¡near ¡certainty. ¡ ¡

slide-10
SLIDE 10

TLA+ ¡spec ¡ (19 ¡pp) ¡

Insert ¡some ¡inten&onal ¡bugs ¡

10 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

Proof ¡ sketch ¡ “no ¡errors ¡found” ¡ ¡

Several ¡CPU ¡months ¡later… ¡

TLA+ ¡spec ¡ (19 ¡pp) ¡ + ¡inten<onal ¡bugs ¡

Bug1 ¡viola>on ¡example ¡ Bug2 ¡viola>on ¡example ¡ Bug3 ¡viola>on ¡example ¡ … ¡… ¡ Bug12 ¡viola>on ¡example ¡ Bug13 ¡viola>on ¡example ¡ Bug14 ¡no ¡error ¡ Bug15 ¡no ¡error ¡ Bug16 ¡no ¡error ¡

A ¡few ¡CPU ¡minutes… ¡

state, ¡ac&ons, ¡invariants ¡

Easy ¡methodology: ¡ ¡Find ¡an ¡ac<on ¡ that ¡seems ¡important ¡and ¡omit ¡it ¡

slide-11
SLIDE 11

TLA+ ¡spec ¡ (19 ¡pp) ¡

Not ¡all ¡bugs ¡violate ¡safety ¡

11 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

Proof ¡ sketch ¡ “no ¡errors ¡found” ¡ ¡

Several ¡CPU ¡months ¡later… ¡

TLA+ ¡spec ¡ (19 ¡pp) ¡ + ¡inten<onal ¡bugs ¡

A ¡few ¡CPU ¡minutes… ¡

state, ¡ac&ons, ¡invariants ¡

AEer ¡analysis: ¡ these ¡bugs ¡ happen ¡not ¡to ¡ violate ¡safety ¡

Bug1 ¡viola>on ¡example ¡ Bug2 ¡viola>on ¡example ¡ Bug3 ¡viola>on ¡example ¡ … ¡… ¡ Bug12 ¡viola>on ¡example ¡ Bug13 ¡viola>on ¡example ¡ Bug14 ¡no ¡error ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡violates ¡liveness ¡ Bug15 ¡no ¡error ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡violates ¡append-­‑only ¡log ¡ Bug16 ¡no ¡error ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡-­‑ ¡violates ¡append-­‑only ¡log ¡

slide-12
SLIDE 12

Now ¡write ¡the ¡formal ¡proof ¡

12 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

Proof ¡ sketch ¡ TLA+ ¡spec ¡ (19 ¡pp) ¡

state, ¡ac&ons, ¡invariants ¡

Model ¡ checking ¡ results ¡ TLA+ ¡proof ¡ (68 ¡pp) ¡

invariants ¡

Understanding ¡ the ¡results ¡ Iden&cal ¡logic ¡but ¡ tons ¡more ¡detail ¡ Write ¡proof ¡ (2 ¡weeks) ¡ (CPU ¡months) ¡ checked ¡

Proof ¡does ¡not ¡permit ¡the ¡ append-­‑only ¡log ¡viola<on ¡bugs. ¡

slide-13
SLIDE 13

Include ¡a ¡slight ¡op&miza&on ¡

13 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡

Proof ¡ sketch ¡ TLA+ ¡spec ¡ (19 ¡pp) ¡

state, ¡ac&ons, ¡invariants ¡

Model ¡ checking ¡ results ¡ TLA+ ¡proof ¡ (68 ¡pp) ¡

invariants ¡

Modified ¡ TLA+ ¡spec ¡ (17 ¡pp) ¡

state, ¡ac&ons, ¡invariants ¡

Modified ¡ TLA+ ¡proof ¡ (64 ¡pp) ¡

invariants ¡

Understanding ¡ the ¡results ¡ Iden&cal ¡logic ¡but ¡ tons ¡more ¡detail ¡ Slightly ¡op&mize ¡ implementa&on ¡ Revise ¡proof ¡ (2 ¡hours) ¡ Write ¡proof ¡ (2 ¡weeks) ¡ (CPU ¡months) ¡ checked ¡ checked ¡

slide-14
SLIDE 14

Conclusions ¡

14 ¡ August ¡20, ¡2012 ¡ Inser&ng ¡Inten&onal ¡Bugs ¡for ¡Model ¡Checking ¡Assurance ¡ invariants ¡

  • Proof ¡sketch ¡was ¡valuable ¡
  • Helped ¡understand ¡model ¡results ¡
  • Guided ¡formal ¡proof

¡ ¡

  • Assurance ¡via ¡inten&onal ¡bugs ¡before ¡proof ¡
  • Be_er ¡to ¡specify ¡the ¡actual ¡invariant, ¡

not ¡the ¡(stronger) ¡proof ¡invariant ¡ ¡

  • Amazingly ¡easy ¡to ¡create ¡proof ¡for ¡

slightly ¡modified ¡specifica&on ¡ ¡