git: 94f08f6a84e3 - stable/15 - nfsuserd: Fix OOB access on membership of too many groups, take 2
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 09 Oct 2025 20:41:25 UTC
The branch stable/15 has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=94f08f6a84e3e57692c1d244d234007b5a9f5cc5
commit 94f08f6a84e3e57692c1d244d234007b5a9f5cc5
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2025-10-09 17:03:11 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-10-09 20:40:43 +0000
nfsuserd: Fix OOB access on membership of too many groups, take 2
Forgot to reset 'ngroup' after one of the calls to getgrouplist() in the
previous commit with same title (referenced also below).
MFC after: 1 hour
Fixes: e6c623c86ab4 ("Add support for the "-manage-gids" option to the nfsuserd daemon.")
Fixes: bb339adfb2a2 ("nfsuserd: Fix OOB access on membership of too many groups")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 75eb6846269bb9bec1eaf4f0ad93d7525715b550)
---
usr.sbin/nfsuserd/nfsuserd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/usr.sbin/nfsuserd/nfsuserd.c b/usr.sbin/nfsuserd/nfsuserd.c
index 0e5c9c8f1e50..058253beaf95 100644
--- a/usr.sbin/nfsuserd/nfsuserd.c
+++ b/usr.sbin/nfsuserd/nfsuserd.c
@@ -629,6 +629,7 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
syslog(LOG_ERR,
"Group list of user '%s' too big",
pwd->pw_name);
+ ngroup = NGROUPS;
}
nid.nid_ngroup = ngroup;
nid.nid_grps = grps;