From owner-svn-src-stable-11@freebsd.org Wed Aug 15 22:32:44 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA11B1072C90; Wed, 15 Aug 2018 22:32:44 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FCA57FE22; Wed, 15 Aug 2018 22:32:44 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 420FD10CA2; Wed, 15 Aug 2018 22:32:44 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FMWiv9022769; Wed, 15 Aug 2018 22:32:44 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FMWixM022768; Wed, 15 Aug 2018 22:32:44 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201808152232.w7FMWixM022768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 15 Aug 2018 22:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337879 - stable/11/lib/libjail X-SVN-Group: stable-11 X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: stable/11/lib/libjail X-SVN-Commit-Revision: 337879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2018 22:32:44 -0000 Author: jamie Date: Wed Aug 15 22:32:43 2018 New Revision: 337879 URL: https://svnweb.freebsd.org/changeset/base/337879 Log: Load filesystem modules associated with allow.mount permissions. PR: 192092 Modified: stable/11/lib/libjail/jail.c Modified: stable/11/lib/libjail/jail.c ============================================================================== --- stable/11/lib/libjail/jail.c Wed Aug 15 22:25:05 2018 (r337878) +++ stable/11/lib/libjail/jail.c Wed Aug 15 22:32:43 2018 (r337879) @@ -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 { /*