]> git.proxmox.com Git - mirror_zfs.git/commitdiff
OpenZFS 6101 - attempt to lzc_create() a filesystem under a volume results in a panic
authorAndriy Gapon <avg@FreeBSD.org>
Thu, 13 Apr 2017 21:32:08 +0000 (14:32 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 14 Apr 2017 18:11:28 +0000 (11:11 -0700)
Authored by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>
When querying ZPL properties verify that the objset is of type
DMU_OST_ZFS.

OpenZFS-issue: https://www.illumos.org/issues/6101
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ce2243a
Closes #6015

module/zfs/zfs_ioctl.c
module/zfs/zfs_vfsops.c

index 534df5a06274973b337c5b7cc4a5955aa5105f6f..109762795e8cdf38ba2b52f6654951586c50e836 100644 (file)
@@ -2998,6 +2998,9 @@ zfs_fill_zplprops_impl(objset_t *os, uint64_t zplver,
 
        ASSERT(zplprops != NULL);
 
+       if (os != NULL && os->os_phys->os_type != DMU_OST_ZFS)
+               return (SET_ERROR(EINVAL));
+
        /*
         * Pull out creator prop choices, if any.
         */
index 0b8214e0f7ffaae5a28651b532f734a429de7777..40fd5f7648d5f808339ae2bb0081db46541a6842 100644 (file)
@@ -2058,8 +2058,10 @@ zfs_get_zplprop(objset_t *os, zfs_prop_t prop, uint64_t *value)
        else
                pname = zfs_prop_to_name(prop);
 
-       if (os != NULL)
+       if (os != NULL) {
+               ASSERT3U(os->os_phys->os_type, ==, DMU_OST_ZFS);
                error = zap_lookup(os, MASTER_NODE_OBJ, pname, 8, 1, value);
+       }
 
        if (error == ENOENT) {
                /* No value set, use the default value */