Skip to content

eBPF-based security platform

docs: report already_loaded as a load failure in phase pin

Daniel Borkmann3b4e2ca2458e
diff --git a/Documentation/reference/failure-categories.rst b/Documentation/reference/failure-categories.rst
index 5554b350..155ae995 100644
--- a/Documentation/reference/failure-categories.rst
+++ b/Documentation/reference/failure-categories.rst
@@ -16,11 +16,15 @@ commands report failures as messages and exit status only.
Phases
------
-The table lists the phases in the order a load reaches them. The
-``--expect-version-id`` check of ``pre_flight`` runs before ``parse``.
-An unload passes ``pre_flight`` and ``parse``, verifies the directive's
-signature in ``signed_loader_load``, compares the payload in ``pin``,
-measures in ``tpm_extend`` and removes the pins in ``pin``.
+The table lists the phases in the order a load first reaches them. A
+load runs the ``--expect-version-id`` check of ``pre_flight``, reads the
+artifact and checks its header in ``parse``, runs the other
+``pre_flight`` checks, refuses a name that is loaded in ``pin``, checks
+the rest of the artifact in ``parse``, and then goes from
+``target_verify`` to ``done``. An unload passes ``parse`` and
+``pre_flight``, verifies the directive's signature in
+``signed_loader_load``, compares the payload in ``pin``, measures in
+``tpm_extend`` and removes the pins in ``pin``.
.. list-table::
:header-rows: 1
@@ -39,6 +43,10 @@ measures in ``tpm_extend`` and removes the pins in ``pin``.
- Reading and staging the artifact, the header checks, the upatch
name, the signed name, ``payload_sha256`` against the loader and
data, and the signed attach metadata.
+ * - ``pin``
+ - Load: refusing a name that is loaded. Unload: comparing the
+ payload recorded on the pin directory with the directive's, and
+ removing the pins.
* - ``target_verify``
- Opening each ``uprobe``, ``uretprobe``, ``uprobe.multi`` and
``uretprobe.multi`` target binary and comparing its GNU build ID
@@ -54,9 +62,6 @@ measures in ``tpm_extend`` and removes the pins in ``pin``.
- Attaching each program, checking the link against the attach
metadata, pinning it in the private bpffs and recording the payload
on the pin directory.
- * - ``pin``
- - Unload only: comparing the payload recorded on the pin directory
- with the directive's, and removing the pins.
* - ``persist``
- Load only: copying the artifact to
``/var/lib/shirudo/upatches/<name>.upatch``.
diff --git a/Documentation/upatches/test/debugging.rst b/Documentation/upatches/test/debugging.rst
index 94653365..e89964a8 100644
--- a/Documentation/upatches/test/debugging.rst
+++ b/Documentation/upatches/test/debugging.rst
@@ -95,6 +95,10 @@ Find the cause
does not match its content, or attach metadata that is missing
or invalid. Rebuild it with ``shirudo build`` and check that you
passed the right file.
+ * - ``pin``
+ - ``already_loaded``
+ - A upatch of that name is loaded. Unload it with its signed
+ directive first; nothing was touched.
* - ``target_verify``
- ``attach_target_missing``, ``binary_mismatch``,
``parser_rejected``, ``lsm_denied``
@@ -181,10 +185,6 @@ Find the cause
expects, or its recorded digest cannot be read. Build the
directive with ``--payload-sha256`` set to the digest of the
loaded build, from ``shirudo upatch info --json``.
- * - ``pin``
- - ``already_loaded``
- - A upatch of that name is loaded. Unload it with its signed
- directive first; nothing was touched.
* - ``done``
- ``already_unloaded``
- Nothing of that name is loaded. Exit status 0, nothing measured.