git: d8b77cc05ab2 - stable/14 - nmount(2), NFS: Accept 'ngroups_max + 1' groups in "export" credentials

From: Olivier Certner <olce_at_FreeBSD.org>
Date: Thu, 16 Jan 2025 18:08:25 UTC
The branch stable/14 has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=d8b77cc05ab25500636d0d34f10a8a9091778914

commit d8b77cc05ab25500636d0d34f10a8a9091778914
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2024-10-08 09:39:08 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-01-16 18:06:58 +0000

    nmount(2), NFS: Accept 'ngroups_max + 1' groups in "export" credentials
    
    There is no technical reason to limit that to NGROUPS_MAX, which is off
    by one and just our minimum maximum value.
    
    Reviewed by:    rmacklem
    Approved by:    markj (mentor)
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D47013
    
    (cherry picked from commit 84337218786b13f0ebfa834d28de41dce02bc937)
---
 sys/kern/vfs_mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 206618b4ac6b..1990f3714ab6 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1498,7 +1498,7 @@ vfs_domount_update(
 			bcopy(bufp, &export, len);
 			grps = NULL;
 			if (export.ex_ngroups > 0) {
-				if (export.ex_ngroups <= NGROUPS_MAX) {
+				if (export.ex_ngroups <= ngroups_max + 1) {
 					grps = malloc(export.ex_ngroups *
 					    sizeof(gid_t), M_TEMP, M_WAITOK);
 					export_error = copyin(export.ex_groups,