svn commit: r337880 - stable/10/lib/libjail

Jamie Gritton jamie at FreeBSD.org
Wed Aug 15 22:32:56 UTC 2018


Author: jamie
Date: Wed Aug 15 22:32:55 2018
New Revision: 337880
URL: https://svnweb.freebsd.org/changeset/base/337880

Log:
  Load filesystem modules associated with allow.mount permissions.
  
  PR:		192092

Modified:
  stable/10/lib/libjail/jail.c

Modified: stable/10/lib/libjail/jail.c
==============================================================================
--- stable/10/lib/libjail/jail.c	Wed Aug 15 22:32:43 2018	(r337879)
+++ stable/10/lib/libjail/jail.c	Wed Aug 15 22:32:55 2018	(r337880)
@@ -513,7 +513,18 @@ jailparam_set(struct jailparam *jp, unsigned njp, int 
 				}
 				jiov[i - 1].iov_base = nname;
 				jiov[i - 1].iov_len = strlen(nname) + 1;
-				
+			}
+			/*
+			 * Load filesystem modules associated with allow.mount
+			 * permissions.  Ignore failure, since the module may
+			 * be static, and even a failure to load is not a jail
+			 * error.
+			 */
+			if (strncmp(jp[j].jp_name, "allow.mount.", 12) == 0) {
+				if (kldload(jp[j].jp_name + 12) < 0 &&
+				    errno == ENOENT &&
+				    strncmp(jp[j].jp_name + 12, "no", 2) == 0)
+					(void)kldload(jp[j].jp_name + 14);
 			}
 		} else {
 			/*


More information about the svn-src-stable mailing list