pcr commands: Fix session leaks#3534
Merged
JuergenReppSIT merged 1 commit intotpm2-software:masterfrom Dec 16, 2025
Merged
Conversation
All three PCR tools had session leaks in tpm2_tool_onstop(): - tpm2_pcrextend: Authorization sessions and auxiliary sessions were set up but never closed, leaking all sessions. - tpm2_pcrevent: The early return prevented auxiliary session cleanup, leaking all auxiliary sessions. - tpm2_pcrread: The auxiliary session cleanup section was completely empty, leaking all auxiliary sessions. This commit adds proper session cleanup to all three tools: - Close authorization sessions with error checking - Close auxiliary sessions in a loop with path guards - Return accumulated error status Signed-off-by: Zhirang Guo <jonny_guo@apple.com>
JuergenReppSIT
approved these changes
Dec 16, 2025
Member
|
@gzr-lgtm Thank you for the PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tpm2_pcrextend,tpm2_pcrevent, andtpm2_pcrreadhad session leaks intpm2_tool_onstop().This commit adds proper session cleanup to all three tools.
This solves #3533