svn commit: r333197 - stable/11/usr.sbin/mountd

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


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

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

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

Modified: stable/11/usr.sbin/mountd/mountd.c
==============================================================================
--- stable/11/usr.sbin/mountd/mountd.c	Thu May  3 07:22:24 2018	(r333196)
+++ stable/11/usr.sbin/mountd/mountd.c	Thu May  3 07:28:04 2018	(r333197)
@@ -2913,8 +2913,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-11 mailing list