summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs/tmpfs_vfsops.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2013-08-24 13:42:20 +0000
committermarkm <markm@FreeBSD.org>2013-08-24 13:42:20 +0000
commit6228164acab21e650d8ce41758f11a9188cdcf9d (patch)
treef402d81e3fb54380b80e4c1a1d1d5bfe58f4f519 /sys/fs/tmpfs/tmpfs_vfsops.c
parent7afe86e84d4eb4f4ecfc090764da8acb5f214ae6 (diff)
parent413bf347cd8d75b5cc702edaa5b26ae8b14c9f6b (diff)
downloadFreeBSD-src-6228164acab21e650d8ce41758f11a9188cdcf9d.zip
FreeBSD-src-6228164acab21e650d8ce41758f11a9188cdcf9d.tar.gz
MFC
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_vfsops.c')
-rw-r--r--sys/fs/tmpfs/tmpfs_vfsops.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c
index 4d55f51..57b9902 100644
--- a/sys/fs/tmpfs/tmpfs_vfsops.c
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c
@@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$");
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/mutex.h>
+#include <sys/proc.h>
+#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/stat.h>
#include <sys/systm.h>
@@ -138,6 +140,7 @@ tmpfs_mount(struct mount *mp)
sizeof(struct tmpfs_dirent) + sizeof(struct tmpfs_node));
struct tmpfs_mount *tmp;
struct tmpfs_node *root;
+ struct thread *td = curthread;
int error;
/* Size counters. */
u_quad_t pages;
@@ -150,6 +153,9 @@ tmpfs_mount(struct mount *mp)
struct vattr va;
+ if (!prison_allow(td->td_ucred, PR_ALLOW_MOUNT_TMPFS))
+ return (EPERM);
+
if (vfs_filteropt(mp->mnt_optnew, tmpfs_opts))
return (EINVAL);
@@ -420,4 +426,4 @@ struct vfsops tmpfs_vfsops = {
.vfs_statfs = tmpfs_statfs,
.vfs_fhtovp = tmpfs_fhtovp,
};
-VFS_SET(tmpfs_vfsops, tmpfs, 0);
+VFS_SET(tmpfs_vfsops, tmpfs, VFCF_JAIL);
OpenPOWER on IntegriCloud