nss: warm the group mmap cache during initgroups - #9052
Open
karlg100 wants to merge 2 commits into
Open
Conversation
With ignore_group_members enabled, an initgroups result already contains every field needed for a memberless group cache entry. Without warming the group mmap cache, callers resolve each returned GID separately and repeat responder/cache work across VPN-sensitive login paths. Store each returned group in the mmap cache with an empty member list, unless cache invalidation was requested. Reuse one temporary talloc context across the result loop. Dependency: none. This optimization is independent of the memberof transaction engine and may be cherry-picked separately.
Wrap sss_mmap_cache_gr_store in the NSS responder unit test and capture the groups written while ignore_group_members is enabled. Verify both initgroups groups are cached with the expected names and GIDs and no synthetic member list. Dependency: the initgroups group mmap warm-up patch.
karlg100
marked this pull request as ready for review
August 7, 2026 19:50
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.
Problem
With
ignore_group_membersenabled, an initgroups response already containsthe name and GID needed for a memberless group memory-cache entry.
However, the NSS responder currently caches only the initgroups result. It
does not populate the group mmap cache for the groups returned by that
request. Callers may therefore resolve each returned GID separately,
repeating responder and cache work during login and VPN-sensitive
authentication paths.
Solution
While constructing an initgroups response:
ignore_group_members;Failure to warm an individual group remains non-fatal and does not change the
initgroups response.
Tests
Wrap
sss_mmap_cache_gr_store()in the NSS responder unit test and verifythat:
Scope
This is an independent NSS responder optimization. It does not depend on the
verified-group rename or transactional memberOf changes in #9050 and #9051,
and it is not required for the #9049 watchdog fix.
Validation
investigation branches.
before marking this PR ready for review.
Related: #9049