eBPF-based security platform
attest: require the quote and the certification of one TPM boot
Daniel Borkmann25b36091ec76
diff --git a/Documentation/operate/run/attest.rst b/Documentation/operate/run/attest.rstindex 21771b0a..0ff7ac1f 100644--- a/Documentation/operate/run/attest.rst+++ b/Documentation/operate/run/attest.rst@@ -282,7 +282,7 @@ verified with ``--ak-name`` and ``--expect-chain`` only:OK register: carries the nonceOK register: certification names the listed indexOK register: certified contents match the listed value- OK quote and certification are of one TPM reset+ OK quote and certification are of one TPM bootOK config: config root history matches the quoted PCRNOTE config root has no operator approval; use --expect-config-root with --expect-config-pcrNOTE config records a selection; direct TPM writer protection is deferred@@ -304,7 +304,7 @@ Read it in groups:- The nonce, attestation key and endorsement key lines say the TPM youenrolled signed this evidence for your request.- The quote and register lines say the PCR values and the register- value are what the TPM certified, in one TPM reset.+ value are what the TPM certified, in one TPM boot.- The config lines replay the config activation history to the quotedconfig PCR. The note says no root was pinned: this run left out``--expect-config-root``.diff --git a/Documentation/reference/cli/attest-verify.rst b/Documentation/reference/cli/attest-verify.rstindex 2f99f20a..b782d3ee 100644--- a/Documentation/reference/cli/attest-verify.rst+++ b/Documentation/reference/cli/attest-verify.rst@@ -49,7 +49,7 @@ checks:credential the target recovered- the quote and the register certification: signed by the attestation keyas an endorsement primary, covering the listed PCRs and index, of one- TPM reset+ TPM boot: the same reset and restart counts- the config root history against the quoted config PCR, and with``--expect-config-root`` the approved root- the register's public area against the recorded PCR 9 and 11 binding,@@ -182,7 +182,7 @@ attestation key pinned:OK register: carries the nonceOK register: certification names the listed indexOK register: certified contents match the listed value- OK quote and certification are of one TPM reset+ OK quote and certification are of one TPM bootOK config: config root history matches the quoted PCRNOTE config root has no operator approval; use --expect-config-root with --expect-config-pcrNOTE config records a selection; direct TPM writer protection is deferreddiff --git a/Documentation/security/threat-model.rst b/Documentation/security/threat-model.rstindex 2178dd4f..18aea7be 100644--- a/Documentation/security/threat-model.rst+++ b/Documentation/security/threat-model.rst@@ -1070,14 +1070,16 @@ carries.attestation key, its name against its public area and, with``--ak-name``, against the pinned name. It checks the quote's PCRdigest, that the certification names the listed index and value, and-that both come from one TPM reset. It recomputes the index's public area-from the recorded PCR 9 and 11 binding values and the NV writer's public-key, so a recreated index fails. It replays the eventlog to the-certified value, checks that every event's digest derives from its-fields, and checks the PCR 9 anchor. With ``--cert`` and ``--upatch``-it computes the expected init event, with ``--expect-chain`` it compares-the register, and with ``--expect-bind-pcr``, ``--expect-pcr`` and-``--expect-config-root`` it compares the values the operator pins.+that both come from one TPM boot, with the same reset and restart+counts, as a restart clears the register too. It recomputes the index's+public area from the recorded PCR 9 and 11 binding values and the NV+writer's public key, so a recreated index fails. It replays the eventlog+to the certified value, checks that every event's digest derives from+its fields, and checks the PCR 9 anchor. With ``--cert`` and+``--upatch`` it computes the expected init event, with+``--expect-chain`` it compares the register, and with+``--expect-bind-pcr``, ``--expect-pcr`` and ``--expect-config-root`` it+compares the values the operator pins.Which firmware, kernel and initrd values are acceptable is the platformowner's policy.diff --git a/Documentation/start/quickstart.rst b/Documentation/start/quickstart.rstindex 13d1d850..aab127df 100644--- a/Documentation/start/quickstart.rst+++ b/Documentation/start/quickstart.rst@@ -466,7 +466,7 @@ nothing but the evidence, your certificates and your artifacts.OK register: carries the nonceOK register: certification names the listed indexOK register: certified contents match the listed value- OK quote and certification are of one TPM reset+ OK quote and certification are of one TPM bootOK config: config root history matches the quoted PCRNOTE config root has no operator approval; use --expect-config-root with --expect-config-pcrNOTE config records a selection; direct TPM writer protection is deferreddiff --git a/testing/functional/tpm/t4003-register.sh b/testing/functional/tpm/t4003-register.shindex 73ff1f46..bff9912f 100644--- a/testing/functional/tpm/t4003-register.sh+++ b/testing/functional/tpm/t4003-register.sh@@ -379,7 +379,7 @@ test_expect_success 'a late binding is told apart by the phase value and the inigrep -q "^ NOTE binding: made in the root file system" "$WORK/report6" &&grep -q "^ OK eventlog: one init record for this TPM reset (2 this boot)" "$WORK/report6" &&grep -q "^ OK register: init record is of the TPM" "$WORK/report6" &&- grep -q "^ OK quote and certification are of one TPM reset" "$WORK/report6" &&+ grep -q "^ OK quote and certification are of one TPM boot" "$WORK/report6" &&! $S attest verify --evidence="$WORK/evidence2.json" --nonce=$nonce \--ak-name="$(cat "$WORK/ak")" --cert="$WORK/keys/cert.der" \--require-initrd --expect-bind-pcr=11=$PHASE >"$WORK/report6b" &&diff --git a/util/attest.c b/util/attest.cindex c95a255d..8f9ff705 100644--- a/util/attest.c+++ b/util/attest.c@@ -1059,10 +1059,12 @@ int attest_verify(const char *evidence, size_t len,!memneq_explicit(certify.nv_data, reg_value, 32),"register: certified contents match the listed value");}+ /* A restart clears the register as a reset does. */if (qrc == 0 && crc == 0)say(&rep, quote.reset_count == certify.reset_count &&+ quote.restart_count == certify.restart_count &"e.firmware_version == certify.firmware_version,- "quote and certification are of one TPM reset");+ "quote and certification are of one TPM boot");if (config.present || expect->have_config_root ||expect->have_config_pcr) {