eBPF-based security platform
upatch: say what a failed register extend leaves
Daniel Borkmannbb31077c9b59
diff --git a/Documentation/reference/failure-categories.rst b/Documentation/reference/failure-categories.rstindex ef539d40..6c381a5a 100644--- a/Documentation/reference/failure-categories.rst+++ b/Documentation/reference/failure-categories.rst@@ -202,10 +202,12 @@ Categories- The register lock could not be taken, or this boot's records couldnot be read or what they do not cover could not be undone, in whichcase nothing was loaded or detached, or the TPM or the extend- failed. A load is- undone when the register did not move. When the extend succeeded and the- eventlog append failed, the message reads ``eventlog append failed- after the extend``.+ failed. A failed extend undoes a load and detaches nothing for an+ unload, though a lost answer can leave the register moved, and the+ message then reads ``the TPM may have taken the event without its+ record``. When the extend succeeded and the eventlog append failed,+ the message reads ``eventlog append failed after the extend`` and+ the load stays.- Check ``shirudo status``. A register ahead of the eventlog shows as``tampered``; handle that as an incident.* - ``unknown``diff --git a/builtin-upatch.c b/builtin-upatch.cindex 1542cd0f..b8b0f567 100644--- a/builtin-upatch.c+++ b/builtin-upatch.c@@ -2379,20 +2379,19 @@ static int upatch_chain_event_locked(const char *tag, const char *type,ret = chain_extend(event, chain);if (ret == -ENODEV) {- pr_err("upatch %s: TPM register unavailable (category: "- "tpm_error): done but not measured; shirudo needs the "- "register init bound this boot", op);+ pr_err("upatch %s: TPM register unavailable (category: tpm_error): not measured; shirudo needs the register init bound this boot",+ op);return ret;}if (ret == -EACCES) {- pr_err("upatch %s: register is not the one init bound "- "(category: tampered): done but not measured; the "- "operator must reconcile", op);+ pr_err("upatch %s: register is not the one init bound (category: tampered): not measured; the operator must reconcile",+ op);return ret;}+ /* A lost answer or a failed read back: the register may have moved. */if (ret) {- pr_err("upatch %s: register extend failed (category: tpm_error): "- "done but not measured; the operator must reconcile", op);+ pr_err("upatch %s: register extend failed (category: tpm_error): the TPM may have taken the event without its record; the operator must reconcile",+ op);return ret;}if (measured)