Skip to content

eBPF-based security platform

docs: describe a pin directory that cannot be read

John Fastabend5795f8d4a750
diff --git a/Documentation/operate/deploy/initialize.rst b/Documentation/operate/deploy/initialize.rst
index 31cf862a..d70617c8 100644
--- a/Documentation/operate/deploy/initialize.rst
+++ b/Documentation/operate/deploy/initialize.rst
@@ -285,6 +285,11 @@ the same upatch again. The usual cause is a kernel on which the upatch
no longer loads, or a device that an XDP upatch selects whose driver
refuses it. :ref:`boot-restore-lockout` describes the way out.
+Init stops the same way, with ``boot-restore: cannot read the pins of
+<name>`` and the error, when it cannot read the pin directory of an
+archived upatch to tell whether it is loaded already. It does not
+restore that upatch.
+
Register binding failures
~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/Documentation/reference/cli/upatch-list.rst b/Documentation/reference/cli/upatch-list.rst
index 47c42f38..c20878da 100644
--- a/Documentation/reference/cli/upatch-list.rst
+++ b/Documentation/reference/cli/upatch-list.rst
@@ -29,8 +29,8 @@ Description
``init`` restores at boot, and the pin directories under
``/run/shirudo/bpffs/upatches/``:
-- one row per archived artifact: its name, ``LOADED`` ``yes`` or
- ``no``, its type (``load`` or ``unload``), its payload kind (``bpf``
+- one row per archived artifact: its name, ``LOADED`` ``yes``, ``no``
+ or ``?``, its type (``load`` or ``unload``), its payload kind (``bpf``
or ``java``) and the first 16 hexadecimal characters of its payload
digest. A Java upatch is loaded while its installed jar is the
archived one.
@@ -38,6 +38,10 @@ Description
``not archived, gone at reboot``
An archived artifact that cannot be read is listed as ``unreadable``.
+An archived upatch whose pin directory cannot be read, for a reason
+other than its absence, has ``LOADED`` ``?``: ``list`` reports ``upatch
+list: cannot read the pins of <name>`` with the error, lists the other
+upatches and exits 1.
The ``NAME`` column is as wide as the longest name it holds, and 24
characters at least.
@@ -58,7 +62,9 @@ Options
- Print one JSON object: ``schema`` (1) and ``upatches``, a list of
``name``, ``type``, ``payload_type``, ``loaded``, ``archived`` and
``payload_sha256``. A upatch without an archive has ``type`` and
- ``payload_sha256`` ``null`` and no ``payload_type``.
+ ``payload_sha256`` ``null`` and no ``payload_type``. ``loaded`` is
+ ``null`` for an archived upatch whose pin directory cannot be
+ read.
Exit status
-----------
@@ -72,7 +78,9 @@ Exit status
* - 0
- The list was printed.
* - 1
- - The JSON document could not be built.
+ - The pin directory of an archived upatch could not be read: the
+ list was printed, with ``LOADED`` ``?`` for that upatch. Or the
+ JSON document could not be built.
* - 2
- A usage error: an unknown option, ``--json`` given twice, or an
argument.
diff --git a/Documentation/reference/cli/upatch-reconcile.rst b/Documentation/reference/cli/upatch-reconcile.rst
index 57f08d5d..de97e008 100644
--- a/Documentation/reference/cli/upatch-reconcile.rst
+++ b/Documentation/reference/cli/upatch-reconcile.rst
@@ -57,7 +57,9 @@ upatch, not the devices it reaches.
Every upatch is checked before any is attached. An archive that differs
from what the records say was loaded stops the pass with ``tampered``,
-and no upatch gets a new link until that is resolved. Pins of a load
+and no upatch gets a new link until that is resolved. A pin directory
+that cannot be read, for a reason other than its absence, stops the pass
+with ``unknown`` in ``pre_flight``. Pins of a load
still in progress, or of one that stopped before its record, are skipped,
as is a upatch unloaded or replaced during the pass; ``status`` reports
a load that stopped under ``UpatchesMeasured``.
diff --git a/Documentation/reference/failure-categories.rst b/Documentation/reference/failure-categories.rst
index 032fb055..d01a62df 100644
--- a/Documentation/reference/failure-categories.rst
+++ b/Documentation/reference/failure-categories.rst
@@ -289,7 +289,9 @@ Categories
cannot be read, which leave ``eventlog.max_bytes`` unknown, or the
``lsm_link`` pin or, from ``upatch reconcile``, an XDP program pin
that cannot be opened for a reason that says nothing about the pin,
- such as ``EMFILE`` or ``ENOMEM``.
+ such as ``EMFILE`` or ``ENOMEM``, or the pin directory of a upatch
+ that cannot be read for a reason other than its absence: the pass
+ stops before it attaches anything.
- Read ``message`` and the journal. For ``persist``, check the space
on the file system that holds ``/var/lib/shirudo``.