svn commit: r333198 - stable/10/usr.sbin/mountd

Andriy Gapon avg at FreeBSD.org
Thu May 3 07:28:50 UTC 2018


Author: avg
Date: Thu May  3 07:28:49 2018
New Revision: 333198
URL: https://svnweb.freebsd.org/changeset/base/333198

Log:
  MFC r332559: mountd: fix a crash when getgrouplist reports too many groups
  
  Sponsored by:	Panzura

Modified:
  stable/10/usr.sbin/mountd/mountd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/mountd/mountd.c
==============================================================================
--- stable/10/usr.sbin/mountd/mountd.c	Thu May  3 07:28:04 2018	(r333197)
+++ stable/10/usr.sbin/mountd/mountd.c	Thu May  3 07:28:49 2018	(r333198)
@@ -2955,8 +2955,11 @@ parsecred(char *namelist, struct xucred *cr)
 		}
 		cr->cr_uid = pw->pw_uid;
 		ngroups = XU_NGROUPS + 1;
-		if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups))
+		if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) {
 			syslog(LOG_ERR, "too many groups");
+			ngroups = XU_NGROUPS + 1;
+		}
+
 		/*
 		 * Compress out duplicate.
 		 */


More information about the svn-src-stable-10 mailing list