summaryrefslogtreecommitdiffstats
path: root/sys/tmpfs/tmpfs_vfsops.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2016-07-11 22:36:25 +0000
committertedu <tedu@openbsd.org>2016-07-11 22:36:25 +0000
commit77ad037f655f6abb576b1758f10b8096a7f29d57 (patch)
treeddf0dbeaa94c59a26ff92d41ac7bcdc50ef8b773 /sys/tmpfs/tmpfs_vfsops.c
parentAdd missing "recvfd" pledge promise: Raf Czlonka reported ssh coredumps (diff)
downloadwireguard-openbsd-77ad037f655f6abb576b1758f10b8096a7f29d57.tar.xz
wireguard-openbsd-77ad037f655f6abb576b1758f10b8096a7f29d57.zip
don't allow mounting with noval owner. panics later.
reported by Tim Newsham at NCC. ok millert natano
Diffstat (limited to 'sys/tmpfs/tmpfs_vfsops.c')
-rw-r--r--sys/tmpfs/tmpfs_vfsops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c
index b0f0e53d799..ff49be01dd8 100644
--- a/sys/tmpfs/tmpfs_vfsops.c
+++ b/sys/tmpfs/tmpfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmpfs_vfsops.c,v 1.8 2016/01/13 13:01:40 gsoares Exp $ */
+/* $OpenBSD: tmpfs_vfsops.c,v 1.9 2016/07/11 22:36:25 tedu Exp $ */
/* $NetBSD: tmpfs_vfsops.c,v 1.52 2011/09/27 01:10:43 christos Exp $ */
/*
@@ -125,6 +125,9 @@ tmpfs_mount(struct mount *mp, const char *path, void *data,
error = copyin(data, &args, sizeof(struct tmpfs_args));
if (error)
return error;
+ if (args.ta_root_uid == VNOVAL || args.ta_root_gid == VNOVAL ||
+ args.ta_root_mode == VNOVAL)
+ return EINVAL;
/* Get the memory usage limit for this file-system. */
if (args.ta_size_max < PAGE_SIZE) {