]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Enable PF_FSTRANS for ioctl secpolicy callbacks (#4571)
authorTim Chase <tim@chase2k.com>
Mon, 2 May 2016 17:00:50 +0000 (12:00 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 2 May 2016 17:00:50 +0000 (10:00 -0700)
At the very least, the zfs_secpolicy_write_perms ioctl security policy
callback, which calls dsl_dataset_hold(), can require freeing memory and,
therefore, re-enter ZFS.  This patch enables PF_FSTRANS for all of the
security policy callbacks similarly to the manner in which it's enabled
for the actual ioctl callback.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4554

module/zfs/zfs_ioctl.c

index 50f6a7a2c2f56462f26c741fb60a8ec8d5200662..6cc50e6da62831b5612f94863b55017c237e011b 100644 (file)
@@ -5829,8 +5829,11 @@ zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
        }
 
 
-       if (error == 0 && !(flag & FKIOCTL))
+       if (error == 0 && !(flag & FKIOCTL)) {
+               cookie = spl_fstrans_mark();
                error = vec->zvec_secpolicy(zc, innvl, CRED());
+               spl_fstrans_unmark(cookie);
+       }
 
        if (error != 0)
                goto out;