Skip to content

Commit 52475b5

Browse files
dweeezilnedbass
authored andcommitted
Enable PF_FSTRANS for ioctl secpolicy callbacks (#4571)
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
1 parent 2cb7734 commit 52475b5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

module/zfs/zfs_ioctl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5817,8 +5817,11 @@ zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
58175817
}
58185818

58195819

5820-
if (error == 0 && !(flag & FKIOCTL))
5820+
if (error == 0 && !(flag & FKIOCTL)) {
5821+
cookie = spl_fstrans_mark();
58215822
error = vec->zvec_secpolicy(zc, innvl, CRED());
5823+
spl_fstrans_unmark(cookie);
5824+
}
58225825

58235826
if (error != 0)
58245827
goto out;

0 commit comments

Comments
 (0)