Skip to content

eBPF-based security platform

docs: give the boot-restore lockout one home

Daniel Borkmannefc5f28539b5
diff --git a/Documentation/operate/maintain/backup-recovery.rst b/Documentation/operate/maintain/backup-recovery.rst
index 6dfea18a..4dee7386 100644
--- a/Documentation/operate/maintain/backup-recovery.rst
+++ b/Documentation/operate/maintain/backup-recovery.rst
@@ -211,37 +211,65 @@ A second ``init`` in the same boot does not help. It stops with:
#. Reboot.
+.. _boot-restore-lockout:
+
An archived upatch no longer loads at boot
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The usual cause is a new kernel on which an upatch fails with
+Symptoms:
+
+- The journal shows ``boot-restore: failed to apply <file>`` before the
+ ``init`` lines above.
+- ``shirudo status`` reports ``reboot-pending``, and commands other than
+ ``status`` and ``image status`` fail with ``shirudo: image state:
+ Operation now in progress``.
+
+Cause: ``init`` restores the archive in name order and stops at the
+first upatch that fails, without unloading what it already loaded. The
+usual cause is a new kernel on which the upatch fails with
``verifier_rejected``, ``attach_target_missing`` or
-``kernel_abi_unsupported``. The journal shows ``boot-restore: failed to
-apply <file>`` before the ``init`` lines above. ``init`` restores the
-archive in name order and stops at the first failure without unloading
-what it already loaded.
+``kernel_abi_unsupported``. For an XDP upatch, a line ``XDP: attach
+<device>`` before it names a device whose driver refused the program: a
+NIC added since the load, or a setting that survived the reboot, in the
+NIC's firmware or the hypervisor, such as LRO, header-data split or a
+device without multi-buffer XDP.
``init`` restores the same archive at every boot, so a reboot fails the
same way. These do not work:
-- A second ``init``: it refuses the pending activation
+- A second ``init``: it refuses the pending activation.
- ``shirudo bpm uninstall`` and ``shirudo upatch unload``: every command
- that reads target state is refused, except ``status`` and ``image``
+ that reads target state is refused, except ``status`` and ``image``.
- Deleting the file from ``/var/lib/shirudo/upatches``: the seal refuses
- it
+ it.
+
+For an XDP device, undo the setting or remove the device, and reboot. A
+device that cannot take XDP needs an upatch signed with a class mask
+that leaves it out. Otherwise remove the upatch from a boot on which it
+loads:
+
+#. Before you reboot, read the name of the failed upatch:
-What works is to remove the upatch from a boot on which it loads:
+ .. code-block:: console
+
+ target# journalctl -b -u shirudo-initrd.service
+
+ The line is ``boot-restore: failed to apply <file>``.
#. Boot a kernel on which the upatch loads, usually the previous one,
- from a UKI that names the runtime image still in
- ``/var/lib/shirudo/images``.
+ from its UKI in the boot menu. Its runtime image must still be where
+ its UKI bootstrap file names it, in ``/var/lib/shirudo/images``.
+
#. Check that ``shirudo status`` reports ``ok``.
+
#. Remove the upatch. Uninstall its package with
``shirudo bpm uninstall <package>``, unload it with its unload
directive (:doc:`/reference/cli/upatch-unload`), or, for an upatch
from the tree, publish a ``delete`` operation and let the tree sync
apply it.
-#. Boot the new kernel.
+
+#. Boot the new kernel's UKI and check init as described in
+ :doc:`/operate/deploy/initialize`.
If no kernel loads the upatch, shirudo offers no recovery in place.
Decommission the target and provision it again. To avoid the state,
diff --git a/Documentation/operate/maintain/upgrade.rst b/Documentation/operate/maintain/upgrade.rst
index 5f29b9d2..b43ab9b1 100644
--- a/Documentation/operate/maintain/upgrade.rst
+++ b/Documentation/operate/maintain/upgrade.rst
@@ -255,47 +255,10 @@ canary target before you upgrade the fleet.
8. Check init as described in :doc:`/operate/deploy/initialize`, and update the
PCR values your verifiers pin.
-.. _boot-restore-lockout:
-
-Recover from a restore failure after a kernel upgrade
------------------------------------------------------
-
When an archived upatch does not load on the new kernel, init stops the
-restore and the config activation stays pending. ``status`` reports
-``reboot-pending``, and commands other than ``status`` and
-``image status`` fail with
-``shirudo: image state: Operation now in progress``. A reboot into the
-same kernel repeats the failure. ``bpm uninstall`` and ``upatch unload``
-are refused in this state, and the seal stops root from removing the
-archived file. shirudo has no command that leaves this state on the new
-kernel.
-
-What works is the previous kernel, on which the upatch still loads:
-
-1. Before you reboot, read the name of the failed upatch in the journal:
-
- .. code-block:: console
-
- target# journalctl -b -u shirudo-initrd.service
-
- The line is ``boot-restore: failed to apply <file>``.
-
-2. Boot the previous kernel's UKI from the boot menu. Its runtime image
- must still be where its UKI bootstrap file names it.
-
-3. Check that init completed, as described in :doc:`/operate/deploy/initialize`.
-
-4. Uninstall the package that holds the upatch, retract it from the
- upatch tree, or unload it with its unload directive. For a package:
-
- .. code-block:: console
-
- target# shirudo bpm uninstall <package>
-
-5. Boot the new kernel's UKI and check init again.
-
-Without a previous kernel that boots, no supported procedure removes the
-upatch.
+restore and the target stays ``reboot-pending`` at every boot of that
+kernel. :ref:`boot-restore-lockout` describes the way out, which needs
+the previous kernel's UKI.
Next steps
----------
diff --git a/Documentation/operate/run/read-status.rst b/Documentation/operate/run/read-status.rst
index 64ac0f09..476e810a 100644
--- a/Documentation/operate/run/read-status.rst
+++ b/Documentation/operate/run/read-status.rst
@@ -659,7 +659,7 @@ its own.
3. Check the verdict again. A ``reboot-pending`` verdict after the next
boot, with ``boot-restore`` errors in the journal, means an archived
- upatch fails to load at every boot. :doc:`/operate/maintain/backup-recovery`
+ upatch fails to load at every boot. :ref:`boot-restore-lockout`
describes what works in that case.
.. _status-degraded:
diff --git a/Documentation/operate/troubleshoot/troubleshooting.rst b/Documentation/operate/troubleshoot/troubleshooting.rst
index 220296e5..91d96646 100644
--- a/Documentation/operate/troubleshoot/troubleshooting.rst
+++ b/Documentation/operate/troubleshoot/troubleshooting.rst
@@ -528,12 +528,8 @@ Causes
multi-buffer XDP.
Action
- A reboot restores the same archive and fails the same way. For an XDP
- device, undo the setting, or remove the device, and reboot. A device
- that cannot take XDP needs an upatch signed with a class mask that
- leaves it out.
- :doc:`/operate/maintain/backup-recovery` describes what works and what does
- not.
+ A reboot restores the same archive and fails the same way.
+ :ref:`boot-restore-lockout` describes what works and what does not.
Status verdicts
---------------