Fix key permission selection and lookup - #14597
Open
tamird wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
@konstantin-s-bogom another honest bug here, syscall test included |
konstantin-s-bogom
requested changes
Sep 3, 2026
Key checks combine owner, group, and other permissions and ignore supplementary groups. Select the owner class first, otherwise a matching nonempty group class, otherwise other permissions. Add possessor permissions to the selected class, matching Linux. KEYCTL_GET_KEYRING_ID returns positive IDs without checking existence or permissions. Share key resolution across lookups and permission changes so retained session keyrings remain addressable after user-namespace transitions. Validate numeric IDs and check SETATTR for KEYCTL_SETPERM without requiring SEARCH. Exercise permission selection, both ID forms, and lookup and permission changes after user-namespace transitions through syscall tests shared by Linux and gVisor. Assisted-by: Codex
tamird
force-pushed
the
fix-key-permission-selection
branch
from
September 4, 2026 01:02
e5bdc21 to
a498081
Compare
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.
Key checks accumulate permissions from owner, group, and other classes and ignore supplementary groups. This can grant access that Linux denies or deny a group member access. Select one class using Linux's precedence, including fallback to other when the group mask is empty, then add possessor permissions.
KEYCTL_GET_KEYRING_ID returns positive IDs without validating them, and KEYCTL_SETPERM cannot find a retained session keyring by numeric ID after a user-namespace change. Share key resolution across lookup and permission changes, resolving the session keyring before the current namespace's key map. Keep the permission check for each operation, allowing SETPERM with SETATTR even when SEARCH is absent.
Exercise permission selection, both ID forms, and lookup and permission changes after a user-namespace transition through syscall tests shared by Linux and gVisor.
Assisted-by: Codex