Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/tpm

FieldValue
SubsystemTPM subsystem, drivers/char/tpm/ (obj-$(CONFIG_TCG_TPM) += tpm.o, torvalds/linux master)
Config gateCONFIG_TCG_TPM (Kconfig “TPM Hardware Support”; obj line verified against torvalds/linux master 2026)
ABI documentationDocumentation/ABI/stable/sysfs-class-tpm (13 What entries; 20 paths counted in the ledger once the ppi/ subtree from Documentation/ABI/testing/sysfs-driver-ppi is included)
Since2.6.12 (device/, caps, pcrs, pubek); 2.6.13 (cancel); 2.6.17 (active, enabled, owned, temp_deactivated); 3.1 (durations, timeouts); 3.6 (ppi/); 5.5 (tpm_version_major); 5.12 (pcr-<H>/<N>)
Live (5.10.134 host)class directory present, 0 devices (no TPM chip in the container; class dir exists per live-sys enumeration)
Ledger IDSYSC-tpm

What it represents

One directory per TPM chip, tpmX, split in two: the class-level files (tpm_version_major, the pcr-<H>/<N> banks, the ppi/ Physical Presence Interface subtree) and the legacy device/ directory holding the TPM 1.2-era introspection files. caps gives manufacturer and TCG version (hex manufacturer ID, e.g. 0x53544d20); pcrs dumps all Platform Configuration Registers as a point-in-time snapshot (SHA-1, 20 bytes per PCR, for 1.1/1.2 chips); durations and timeouts expose the vendor command-execution times and interface timeouts in microseconds, each with a [original]/[adjusted] marker showing whether the driver rescaled msec-reporting chips. The 5.12 addition made PCR reads bank-addressable: pcr-sha256/7 returns one PCR in compact hex. ppi/ mediates BIOS-executed operations (request integers 1-160, 0 = none) under the PPI specification.

Relationship to the device model

The stable ABI anchors everything at /sys/class/tpm/tpmX/device/, which is the parent hardware device under /sys/devices/...; the ppi entry notes that in Linux 4.2 ppi moved to the character-device directory with a tpmX/device/ppi symlink kept for backwards compatibility. The TPM’s userspace command channel is the /dev/tpmX character device (and the TPM 2.0 tpmrm flavor: sibling page tpmrm); sysfs carries identification and policy, not command I/O.

Attributes

AttributeR/WUnit/formatConditional?Source
tpmX/device/capsROmanufacturer hex, TCG version, firmware versionalwaysABI stable sysfs-class-tpm (2.6.12)
tpmX/device/pcrsROPCR dump, PCR-NN: hex linesalwaysABI stable sysfs-class-tpm (2.6.12)
tpmX/device/pubekROendorsement key structure; unavailable when owned (TPM 1.2)alwaysABI stable sysfs-class-tpm (2.6.12)
tpmX/device/cancelWOany value; cancels the pending command via vendor opalwaysABI stable sysfs-class-tpm (2.6.13)
tpmX/device/{active,enabled,owned,temp_deactivated}RO0/1 flags: accepting commands / visible to OS / TakeOwnership done / temporarily deactivatedalwaysABI stable sysfs-class-tpm (2.6.17)
tpmX/device/durationsROshort/medium/long usecs + [original]/[adjusted]alwaysABI stable sysfs-class-tpm (3.1)
tpmX/device/timeoutsROfour interface timeouts in usecs + markeralwaysABI stable sysfs-class-tpm (3.1)
tpmX/tpm_version_majorROTCG spec major version (e.g. 2)alwaysABI stable sysfs-class-tpm (5.5)
tpmX/pcr-<H>/<N>ROPCR N of hash bank H in compact hexbanks per chipABI stable sysfs-class-tpm (5.12)
tpmX/ppi/mixedPPI subtree: version (RO), request (RW, 0-160), response, transition_action, tcg_operations, vs_operations (RO, 1.2+ only)only if BIOS supports PPIABI testing sysfs-driver-ppi (3.6)

Safety and writes

Reads are safe, with two behavioral caveats from the ABI: pcrs output is only valid for a snapshot in time, and pubek returns nothing useful once a 1.2 chip is owned (the driver stores no secrets, so it cannot authorize the read). Writes: cancel aborts an in-flight command (vendor-specific effect); ppi/request queues a pre-OS operation that the BIOS executes at next boot – clearing TPM ownership data is in that request range, which is the destructive case, gated in practice by root. No capability requirements are stated in the ABI files.

References

  • Documentation/ABI/stable/sysfs-class-tpm, Documentation/ABI/testing/sysfs-driver-ppi (cached copies; online: https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-class-tpm)
  • drivers/char/tpm/Makefile, drivers/char/tpm/Kconfig (torvalds/linux master; fetched)
  • Ledger row SYSC-tpm (20 paths); /sys/class/tpm present with 0 devices per source-cache/live-sys/class-list.txt
  • Sibling pages: tpmrm