New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 687330 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug


Participants' hotlists:
TPM-Userland-Robustness


Sign in to add a comment

trunks: check for stale virtual handles

Project Member Reported by apronin@chromium.org, Jan 31 2017

Issue description

In some cases (e.g. after a TPM resume) a transient object handle may be flushed from TPM without trunksd Resource Manager knowing about that. In that case, the TPM may re-use that handle. The current Resource Manager logic in that case will find an old virtual handle corresponding to that TPM object handle and also re-use it. 

This leads to two callers (possibly belonging to two different daemons) using the same virtual handler, while thinking they talk to two different objects. And if an application later uses this handle to access the old object, it will actually access the new one. Quite probably it will flush that object when closing the handle when it sees that it no longer works for its purposes, and that will actually unexpectedly flush the good new object for the other caller.

Add knowledge to the resource manager when to expect a new handle, and when to expect re-using an existing virtual handle. If it expects a new handle (e.g. as a result of Load) but sees that a corresponding virtual handle already exists, create a new virtual handle, and mark the old one as invalid. Similarly, track the cases when an existing handle was expected but a new virtual handle was actually created.
 
Labels: -Pri-1 Pri-2
As an additional precaution it may also make sense to track the virtual handler origin (e.g. which D-Bus interface it came from) and similarly handling the cases when a transient object loaded by one application is attempted to be used by a different application.

Are there cases when a handle created by one application (e.g. tpm_manager) is then passed to a different application (attestation, cryptohome), which then uses it? Shall those cases be supported/allowed, if not?

But in any case adding these checks would require more context to be propagated to the ResourceManager level, and thus extending the basic SendCommand() interface. So, stage 2, at best.
Components: OS>Systems>Security
Labels: TPM-Userland-Robustness

Sign in to add a comment