Skip to content

Commit

Permalink
Enable PF_FSTRANS for ioctl secpolicy callbacks (#4571)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Closes #4554
  • Loading branch information
dweeezil authored and nedbass committed May 6, 2016
1 parent 2cb7734 commit 52475b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5817,8 +5817,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;
Expand Down

0 comments on commit 52475b5

Please sign in to comment.