summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2013-03-12 19:25:22 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2013-03-12 19:25:22 +0000
commitb63b6f0204a00edd3eea013cdcbb9b0eaf5d2f33 (patch)
tree0b8508a23ebfc95ebaf498ebefbd2e03fc5bce05
parenteddec1f8e073d28091aae9c7be37f7c6e433cfb0 (diff)
downloadillumos-joyent-b63b6f0204a00edd3eea013cdcbb9b0eaf5d2f33.tar.gz
OS-2008 GZ per-zone /dev/zvol access can make zvol hierarchy can show up in every zone
-rw-r--r--usr/src/uts/common/fs/dev/sdev_zvolops.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/dev/sdev_zvolops.c b/usr/src/uts/common/fs/dev/sdev_zvolops.c
index 09e5559701..192b794c67 100644
--- a/usr/src/uts/common/fs/dev/sdev_zvolops.c
+++ b/usr/src/uts/common/fs/dev/sdev_zvolops.c
@@ -21,7 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright 2012 Joyent, Inc. All rights reserved.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/* vnode ops for the /dev/zvol directory */
@@ -608,6 +608,19 @@ devzvol_lookup(struct vnode *dvp, char *nm, struct vnode **vpp,
int res;
rw_exit(&parent->sdev_contents);
+
+ /*
+ * If we're in the global zone and reach down into a non-global
+ * zone's /dev/zvol then this action could trigger the creation
+ * of all of the zvol devices for every zone into the non-global
+ * zone's /dev tree. This could be a big security hole. To
+ * prevent this, disallow the global zone from looking inside
+ * a non-global zones /dev/zvol. This behavior is similar to
+ * delegated datasets, which cannot be used by the global zone.
+ */
+ if (getzoneid() == GLOBAL_ZONEID)
+ return (EPERM);
+
res = prof_lookup(dvp, nm, vpp, cred);
/*