Repository navigation
<
8000
/div>
fix(bep): test the tpm auth file owner check without root and bound its read - #3543
Merged
Merged
Conversation
…ts read The owner and mode check of a TPM key's authorization file moves into check_auth_file, which takes the file's owner and mode and the proxy's user id, so a test can refuse another user's file without running as root. The read of the authorization file is now bounded at four times the length the store writes: it reads at most one byte past the bound into a buffer sized for it, and a longer file is refused at start as a store error instead of being read whole. A file of several GiB no longer makes the proxy allocate its size. Refs #3510 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 48 minutes for your next included review. View limit details
|
Contributor
|
Approved: no findings at Nothing to do. Clobber: none seen. |
norrietaylor
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Un
7A09
icode 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.
What
Two follow-ups to #3510, both from review notes there:
Refs #3510
A correction to what I said on #3510
I replied there that a length check already ran after the read. That was wrong: no length check existed. The file was read whole, whatever its size. This PR adds the bound.
1. The owner check
The check moves into
check_auth_file, which takes the file's owner, its mode and the proxy's user id as values. A test can then refuse a file owned by another user without creating one, which needs root.2. The bound
The read stops at four times the length the store writes. It reads at most one byte past that bound, into a buffer sized for it. A longer file is refused at start as a store error. A file of several GiB no longer makes the proxy allocate its size.
Testing
the_auth_file_check_refuses_another_owner_and_modes_others_can_usean_oversized_tpm_auth_file_refuses_start_without_reading_it_whole: a file exactly at the bound is read, and one byte more is refused.Workspace lint, tests and the native end-to-end script pass on this commit.
🤖 Generated with Claude Code