# GHSA-JGQP-W77Q-4M87: Container TPM resource manager node can refer to another TPM

- Database: GitHub
- Severity: CVSS 8.4 (High)
- Published: 2026-12-03
- Modified: 2026-12-03

## Tracked as

- [CVE-2026-141355](https://cve.now/CVE-2026-141355.md): lxd: incorrect TPM device number calculation exposes another TPM to a container

## Description

### Summary

Reported from https://github.com/lxc/incus/security/advisories/GHSA-wgg4-rrw6-c64w

When a `tpm` device is attached to a container, Incus derives the
device numbers of the resource manager node (`pathrm`, usually
`/dev/tpmrm0`) from the raw device numbers reported by `swtpm`, using
a wrong constant and the raw device's major number instead of reading
the kernel's own numbers from sysfs. As a result, the resource manager
node for TPM index 0 does not refer to any device, and the resource
manager node for TPM index 244 refers to the resource manager of TPM
index 0 rather than the container's own TPM.

### Details

A container whose `swtpm` instance is assigned TPM index 244 is given,
and allowed by its device cgroup, a resource manager node for TPM
index 0. That TPM belongs to the host when the host has its own TPM,
or to whichever instance first started a TPM device otherwise. TPM
indices are allocated lowest-free, so a client able to add `tpm`
devices to its instances (allowed in restricted projects) can reach
index 244 by attaching enough devices.

Containers with TPM index 0 get a non-functional resource manager
node; this is a functional defect with no security impact.

Virtual machines are not affected, as they use a socket to `swtpm`.

### Proof of concept

When a `tpm` device is attached to a container, Incus derives the
device numbers of the resource manager node (`pathrm`, usually
`/dev/tpmrm0`) from the raw device numbers reported by `swtpm`, using
a wrong constant and the raw device's major number instead of reading
the kernel's own numbers from sysfs. As a result, the resource manager
node for TPM index 0 does not refer to any device, and the resource
manager node for TPM index 244 refers to the resource manager of TPM
index 0 rather than the container's own TPM.

### Impact


Do not allow untrusted clients to attach `tpm` devices to containers,
or remove host and other TPM devices from systems where they can.

## References

- https://github.com/canonical/lxd/security/advisories/GHSA-jgqp-w77q-4m87

Page: https://cve.now/GHSA-JGQP-W77Q-4M87

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
