eBPF-based security platform
proofs: say what ConfigActivation assumes of the journal
Daniel Borkmannbe6bcaa8e647
diff --git a/Documentation/contribute/testing/proof-coverage.rst b/Documentation/contribute/testing/proof-coverage.rstindex 8df6ce1f..4d083084 100644--- a/Documentation/contribute/testing/proof-coverage.rst+++ b/Documentation/contribute/testing/proof-coverage.rst@@ -1182,16 +1182,21 @@ the model follows the C.boot event; ``staged_taken``, ``stage_then_reboot``: ``init`` takesa staged root only when the stage copies the completed record itstarts from and is of an earlier TPM boot, and it does take one;- ``configInUse_vouched``, ``mounted_selected``,- ``consistent_mounted``, ``journal_wellformed``, ``pcr_replay``,- ``completion_by_complete``+ ``mounted_selected``, ``consistent_mounted``: a command runs only+ with the config the record selects; ``configInUse_vouched``+ restates ``configInUse``, which follows ``current_config()`` and+ ``status_config()`` by review; ``journal_wellformed``,+ ``pcr_replay``, ``completion_by_complete``- Commands one at a time; atomic renames of ``state`` and``next-boot``; a crash leaves a prefix of a line; only shirudo- writes the journal and the config mount during a boot; PCRs reset- only at a reboot or TPM Restart; PCRs compared as their lists of- extensions, which ``pcr_value_eq_iff`` justifies for the idealized- hash of ``register_injective`` and SHA-256 meets unless it- collides among the values compared. All but+ writes the config mount during a boot; only shirudo writes the+ journal, between boots too, which R14 says root can, for all but+ ``boot_completion`` and ``completion_by_complete``, which hold+ from any journal; PCRs reset only at a reboot or TPM Restart; PCRs+ compared as their lists of extensions, which ``pcr_value_eq_iff``+ justifies for the idealized hash of ``register_injective`` and+ SHA-256 meets unless it collides among the values compared. All+ but``journal_wellformed``, ``mounted_selected``, ``boot_completion``,``completion_by_complete`` and ``extension_follows_save`` also takea calm TPM, whose boot changes only between commands and never todiff --git a/testing/proofs/lean4/Shirudo/ConfigActivation.lean b/testing/proofs/lean4/Shirudo/ConfigActivation.leanindex f2fd7d15..19caf2f3 100644--- a/testing/proofs/lean4/Shirudo/ConfigActivation.lean+++ b/testing/proofs/lean4/Shirudo/ConfigActivation.lean@@ -63,20 +63,25 @@ For every such sequence:`boot_completion`: from any journal, `init` completes only with thePCR holding exactly the selected config's boot event over the value itstarted from.-- (d) `configInUse_vouched`, `mounted_selected`, `consistent_mounted`: a- command runs only with the config the record selects, and another one is- mounted only while the selection is pending.+- (d) `mounted_selected`, `consistent_mounted`: a command runs only with+ the config the record selects, and another one is mounted only while+ the selection is pending. `configInUse_vouched` restates `configInUse`;+ that it is what `current_config()` and `status_config()` give is by+ review.- (e) `journal_wellformed`: no interruption leaves a journal a later bootrefuses; `pcr_replay`: the PCR of a completed record holds its replay;`completion_by_complete`: a boot event is completed only by `init`'s`complete()`.What the C relies on outside itself is part of the model, not an axiom:-commands run one at a time; a rename of `state` is atomic and survives a-crash once made; a crash in an append leaves a prefix of the line; only-shirudo writes the journal and the config mount during a boot; a PCR-changes only by extension and resets only at a reboot or a TPM Restart;-the model compares PCRs as their lists of extensions, which+commands run one at a time; a rename of `state` or `next-boot` is atomic+and survives a crash once made; a crash in an append leaves a prefix of+the line; only shirudo writes the config mount during a boot; for every+theorem over `Reachable`, only shirudo writes the journal, between boots+too, where R14 lets root rewrite it, while `boot_completion` and+`completion_by_complete` hold from any journal; a PCR changes only by+extension and resets only at a reboot or a TPM Restart; the model+compares PCRs as their lists of extensions, which`pcr_value_eq_iff` justifies for the idealized hash of`Shirudo.Chain.register_injective` and SHA-256 meets unless it collidesamong the values compared; and, for the theorems over `shirudo`, the@@ -1765,7 +1770,9 @@ variable {B R D : Type} [DecidableEq B] [DecidableEq R] [DecidableEq D]variable {digest : Kind → R → D}/-- (d) A config a command runs with is the one the record selects:-consistent, or for `status` pending and mounted. -/+consistent, or for `status` pending and mounted. This holds of every+world, as it restates `configInUse`; that `configInUse` is what+`current_config()` and `status_config()` give is by review. -/theorem configInUse_vouched {w : World B R D} {st : Bool} {m : R}(h : configInUse digest w st = some m) :∃ r q, w.state = some ⟨r, q⟩ ∧ m = r.root ∧ w.mounted = some m ∧