sched: supplementary groups and setresuid/setresgid - #19767
Merged
acassis merged 3 commits intoAug 12, 2026
Conversation
Abhishekmishra2808
requested review from
Donny9,
GUIDINGLI,
anchao,
btashton,
davids5,
hartmannathan,
jerpelea,
pussuw,
raiden00pl and
xiaoxiang781216
as code owners
August 10, 2026 16:01
Abhishekmishra2808
force-pushed
the
feature/supp-groups-and-sudo
branch
from
August 10, 2026 16:08
6602cf8 to
f3e8f00
Compare
Abhishekmishra2808
force-pushed
the
feature/supp-groups-and-sudo
branch
2 times, most recently
from
August 10, 2026 17:38
055ab91 to
0fc9c1b
Compare
Abhishekmishra2808
force-pushed
the
feature/supp-groups-and-sudo
branch
3 times, most recently
from
August 12, 2026 06:40
897a50a to
360775a
Compare
Abhishekmishra2808
force-pushed
the
feature/supp-groups-and-sudo
branch
from
August 12, 2026 07:16
ee6a2d9 to
021c319
Compare
Abhishekmishra2808
force-pushed
the
feature/supp-groups-and-sudo
branch
from
August 12, 2026 07:20
021c319 to
8be13db
Compare
Abhishekmishra2808
force-pushed
the
feature/supp-groups-and-sudo
branch
from
August 12, 2026 09:36
8be13db to
b9e6c77
Compare
Track supplementary GIDs per task group, wire setgroups/getgroups syscalls when CONFIG_SCHED_NGROUPS > 0, and honor them in DAC checks via nxsched_has_gid(). When NGROUPS is 0, libc provides getgroups/ setgroups stubs. initgroups() fails instead of silently truncating when membership exceeds CONFIG_SCHED_NGROUPS. Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
Complete the POSIX credential setters for real/effective/saved UID and GID so login and privilege-drop paths can clear saved-root without relying on setreuid patterns alone. Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
Document CONFIG_SCHED_NGROUPS, setgroups/getgroups/initgroups, and setresuid/setresgid in the user identity guide. Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
Abhishekmishra2808
force-pushed
the
feature/supp-groups-and-sudo
branch
from
August 12, 2026 12:03
b9e6c77 to
c0f8ed8
Compare
xiaoxiang781216
approved these changes
Aug 12, 2026
Contributor
Author
|
@acassis PTAL |
acassis
approved these changes
Aug 12, 2026
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.
Summary
Impact
This change adds POSIX supplementary group support and setresuid/setresgid to NuttX’s user-identity layer. When CONFIG_SCHED_NGROUPS > 0, each task group keeps a supplementary GID list wired through setgroups, getgroups, and initgroups; DAC checks in binfmt exec and inode permission paths now use nxsched_has_gid() so access can be granted via supplementary membership, not only the primary GID. When CONFIG_SCHED_NGROUPS is zero, the kernel omits group syscall code and libc supplies getgroups/setgroups stubs, so builds without supplementary groups stay lean. setresuid and setresgid complete the real/effective/saved credential setters needed for login and privilege-drop flows without relying on setreuid alone. Configs without CONFIG_SCHED_USER_IDENTITY are unaffected.
Testing