Skip to content

eBPF-based security platform

Documentation: name the proofs behind the checks they cover

Daniel Borkmann4625d94029d0
diff --git a/Documentation/contribute/testing/test-coverage.rst b/Documentation/contribute/testing/test-coverage.rst
index 6ba135b0..23723dfc 100644
--- a/Documentation/contribute/testing/test-coverage.rst
+++ b/Documentation/contribute/testing/test-coverage.rst
@@ -12,7 +12,9 @@ This page lists what the tests under :src:`testing/` cover, by family, by
area and by threat, and what no test covers. A test is named by its
number here, and by its file name without ``.sh`` in the family
tables. :doc:`/contribute/testing/testing` explains the families, the numbering
-and how to run them.
+and how to run them. What the proofs cover, for every input within their
+bounds rather than for the inputs a test picks, is on
+:doc:`proof-coverage`.
Families
--------
diff --git a/Documentation/contribute/testing/testing.rst b/Documentation/contribute/testing/testing.rst
index 6c10a2ac..19ae8235 100644
--- a/Documentation/contribute/testing/testing.rst
+++ b/Documentation/contribute/testing/testing.rst
@@ -79,10 +79,15 @@ Test tiers
- :src:`testing/fuzz/`
- On the build host, under libFuzzer, ASan and UBSan
- ``make -C testing fuzz``
+ * - Proofs
+ - :src:`testing/proofs/`
+ - On the build host, with CBMC and Lean 4, about an hour for all
+ - ``make proofs``
``make tests`` in the checkout root, or ``make -C testing``, runs the
unit, CI check, functional and end-to-end tiers in that order. The fuzz
-targets run on their own.
+targets and the proofs run on their own, and CI does not run the
+proofs: :doc:`proofs` says which to run for a change.
Test numbers and families
-------------------------
diff --git a/Documentation/reference/formats/bpm-formats.rst b/Documentation/reference/formats/bpm-formats.rst
index 46e164e5..29015228 100644
--- a/Documentation/reference/formats/bpm-formats.rst
+++ b/Documentation/reference/formats/bpm-formats.rst
@@ -16,6 +16,14 @@ with ``bpm repo update``, ``bpm install``, ``bpm upgrade`` and
``bpm tree sync``. The ``.upatch`` files inside are specified in
:doc:`upatch-format`.
+CBMC proves the target's readers of these formats within the bounds
+:doc:`/contribute/testing/proof-coverage` lists: the tar headers and
+member names, the registry's challenges, tokens, headers and
+descriptors, the package names and versions, the tree publication's
+selectors and operations, and the checks that keep a publication from
+taking a node back. Lean 4 proves the version order total for versions
+of every length.
+
What is signed
--------------
diff --git a/Documentation/reference/formats/upatch-format.rst b/Documentation/reference/formats/upatch-format.rst
index 27394aa2..e30c0786 100644
--- a/Documentation/reference/formats/upatch-format.rst
+++ b/Documentation/reference/formats/upatch-format.rst
@@ -721,6 +721,12 @@ unload later refuses for the section it lacks, and
``api_version``, ``input_format`` and ``export_signal``, and each source
inside the section behind the entries.
+CBMC proves these checks of the reader for every header, of a file of
+any size, and for the signed sections, decoders, policy labels and
+program table within the bounds
+:doc:`/contribute/testing/proof-coverage` lists: what the reader accepts
+lies inside the file, and what it refuses leaves nothing behind.
+
Target admission
----------------
diff --git a/Documentation/security/threat-model.rst b/Documentation/security/threat-model.rst
index ed74368d..21255051 100644
--- a/Documentation/security/threat-model.rst
+++ b/Documentation/security/threat-model.rst
@@ -58,6 +58,10 @@ The fields of the box are:
:doc:`tamper-counters`
- Tests: the target tests under :src:`testing/functional/` that exercise
the refusal
+- Proofs: where a userspace check stands against the threat, the CBMC
+ and Lean 4 proofs of it in
+ :doc:`/contribute/testing/proof-coverage`; a proof holds for the code
+ it reads, within its bounds, not for the kernel or the hooks
- Residual: the residual risks and threats to resolve that bound it
A claim on this page is one of three kinds, and the text says which. A
@@ -868,6 +872,10 @@ other.
:Counters: ``PinXattr`` for a forged payload binding; none for a
modified loader, which the kernel refuses first
:Tests: ``t3104``, ``t6117``, ``t6138``
+:Proofs: ``upatch-header``, ``upatch-signed-sections``,
+ ``upatch-signed-name``, ``upatch-name``, ``upatch-prog-specs``,
+ ``upatch-prog-uprobes``, ``upatch-decoders``,
+ ``upatch-policy-labels``
:Residual: R1, R16
.. _tm-t5:
@@ -950,6 +958,7 @@ tree operations run without it.
:Counters: ``TpmExtend``
:Tests: ``t4002``, ``t4003``, ``t4102``, ``t4103``, ``t6115``,
``t6122``, ``t6128``, ``t6143``, ``t6144``
+:Proofs: ``Shirudo.Chain``, ``eventlog-records``, ``tpm-digest``
:Residual: R4, R12, R20, U6, U8, U9
T6 Boot window
@@ -1026,6 +1035,11 @@ revocation does not reach tree publications (U13).
:Refusal: the ``bpm`` command fails and installs nothing
:Counters: none
:Tests: ``t7005``, ``t7101``, ``t7102``, ``t7103``, ``t7104``, ``t8005``
+:Proofs: ``bpm-tar-header``, ``bpm-tar-octal``, ``bpm-archive-path``,
+ ``bpm-oci-challenge``, ``bpm-oci-token``, ``bpm-oci-header``,
+ ``bpm-oci-descriptor``, ``bpm-semver-model``, ``Shirudo.SemVer``,
+ ``bpm-tree-follows``, ``bpm-tree-reader``, ``json-string``,
+ ``json-limits``
:Residual: R8, R9, U3, U4, U13, U15
T8 Quantum-capable adversaries against the trust anchor
@@ -1103,6 +1117,9 @@ document can carry a software key's signatures (U1).
failed check named
:Counters: none
:Tests: ``t4003``, ``t4004``, ``t4102``
+:Proofs: ``tpm-reader``, ``tpm-attest``, ``tpm-signature``,
+ ``tpm-public``, ``attest-pcr``, ``attest-fields``,
+ ``attest-name-digest``, ``Shirudo.Chain``
:Residual: R10, R11, U1, U8, U9
.. _tm-t10:
@@ -1190,6 +1207,8 @@ Which keys can sign a config is A7, and U2 is the gap there.
refusals move none
:Tests: ``t5101``, ``t5102``, ``t5103``, ``t5104``, ``t6101``,
``t6113``, ``t6127``, ``t6130``, ``t6131``, ``t6132``
+:Proofs: ``config-image``, ``image-bootstrap``, ``image-path``,
+ ``dm-names``
:Residual: R5, R14, U2
T12 Interrupted image activation
@@ -1285,6 +1304,7 @@ commands that reach the real driver.
:Counters: ``TpmExtend`` for a refused extension; none for a
substituted device
:Tests: ``t4103``, ``t6125``
+:Proofs: ``tpm-public``, ``tpm-kdf``
:Residual: U8
Residual risks