summaryrefslogtreecommitdiffstats
path: root/sys/fs/fdescfs
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2015-01-31 17:35:53 +0000
committerjamie <jamie@FreeBSD.org>2015-01-31 17:35:53 +0000
commitc6bc15d7ab08f753864c67985cc70c180d9cf799 (patch)
treea0f122f4b76eb51437a7dd525aaf7fc88d4f887f /sys/fs/fdescfs
parentb397ed48ffe5b08853689953cb68b4ad1dc04241 (diff)
downloadFreeBSD-src-c6bc15d7ab08f753864c67985cc70c180d9cf799.zip
FreeBSD-src-c6bc15d7ab08f753864c67985cc70c180d9cf799.tar.gz
MFC r277855:
Add allow.mount.fdescfs jail flag. PR: 192951 Submitted by: ruben@verweg.com
Diffstat (limited to 'sys/fs/fdescfs')
-rw-r--r--sys/fs/fdescfs/fdesc_vfsops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c
index cb5e3c0..d3d8ce0 100644
--- a/sys/fs/fdescfs/fdesc_vfsops.c
+++ b/sys/fs/fdescfs/fdesc_vfsops.c
@@ -42,6 +42,7 @@
#include <sys/systm.h>
#include <sys/filedesc.h>
#include <sys/kernel.h>
+#include <sys/jail.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/malloc.h>
@@ -78,8 +79,12 @@ fdesc_mount(struct mount *mp)
{
int error = 0;
struct fdescmount *fmp;
+ struct thread *td = curthread;
struct vnode *rvp;
+ if (!prison_allow(td->td_ucred, PR_ALLOW_MOUNT_FDESCFS))
+ return (EPERM);
+
/*
* Update is a no-op
*/
@@ -237,4 +242,4 @@ static struct vfsops fdesc_vfsops = {
.vfs_unmount = fdesc_unmount,
};
-VFS_SET(fdesc_vfsops, fdescfs, VFCF_SYNTHETIC);
+VFS_SET(fdesc_vfsops, fdescfs, VFCF_SYNTHETIC | VFCF_JAIL);
OpenPOWER on IntegriCloud