/** * DOC: Trusted Security Module (TSM) Attestation Report Interface * * The TSM report interface is a common provider of blobs that facilitate * attestation of a TVM (confidential computing guest) by an attestation * service. A TSM report combines a user-defined blob (likely a public-key with * a nonce for a key-exchange protocol) with a signed attestation report. That * combined blob is then used to obtain secrets provided by an agent that can * validate the attestation report. The expectation is that this interface is * invoked infrequently, however configfs allows for multiple agents to * own their own report generation instances to generate reports as * often as needed. * * The attestation report format is TSM provider specific, when / if a standard * materializes that can be published instead of the vendor layout. Until then * the 'provider' attribute indicates the format of 'outblob', and optionally * 'auxblob' and 'manifestblob'.
*/
/* * Malicious or broken userspace has written enough times for * read_generation == write_generation by modular arithmetic without an * interim read. Stop accepting updates until the current report * configuration is read.
*/ if (state->write_generation == state->read_generation - 1) return -EBUSY;
state->write_generation++; return0;
}
guard(rwsem_write)(&tsm_rwsem); if (!provider.ops) return -ENXIO;
/* * The valid privilege levels that a TSM might accept, if it accepts a * privilege level setting at all, are a max of TSM_PRIVLEVEL_MAX (see * SEV-SNP GHCB) and a minimum of a TSM selected floor value no less * than 0.
*/ if (provider.ops->privlevel_floor > val || val > TSM_REPORT_PRIVLEVEL_MAX) return -EINVAL;
rc = try_advance_write_generation(report); if (rc) return rc;
report->desc.privlevel = val;
if (select == TSM_REPORT) {
out = report->outblob;
len = report->outblob_len;
} elseif (select == TSM_MANIFEST) {
out = report->manifestblob;
len = report->manifestblob_len;
} else {
out = report->auxblob;
len = report->auxblob_len;
}
/* * Recall that a NULL @buf is configfs requesting the size of * the buffer.
*/ if (!buf) return len; return memory_read_from_buffer(buf, count, &offset, out, len);
}
guard(rwsem_read)(&tsm_rwsem); if (!report->desc.inblob_len) return -EINVAL;
/* * A given TSM backend always fills in ->outblob regardless of * whether the report includes an auxblob/manifestblob or not.
*/ if (!report->outblob ||
state->read_generation != state->write_generation) return -EWOULDBLOCK;
/* try to read from the existing report if present and valid... */
rc = read_cached_report(report, buf, count, select); if (rc >= 0 || rc != -EWOULDBLOCK) return rc;
/* slow path, report may need to be regenerated... */
guard(rwsem_write)(&tsm_rwsem);
ops = provider.ops; if (!ops) return -ENXIO; if (!report->desc.inblob_len) return -EINVAL;
/* did another thread already generate this report? */ if (report->outblob &&
state->read_generation == state->write_generation) goto out;
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Provide Trusted Security Module attestation reports via configfs");
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.18Bemerkung:
(vorverarbeitet am 2026-06-07)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.