aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_vfsops.c
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2016-07-06 16:54:19 -0700
committerBrian Behlendorf <[email protected]>2016-07-12 13:34:14 -0700
commit7938c2aca741f350921377d0f939e177bc7e84ad (patch)
treeff4ab24e3128c8e8a72a27d172ca521e9f799b53 /module/zfs/zfs_vfsops.c
parent061460dfe222e01f258db7f6bad689c1ebd2634e (diff)
Don't allow accessing XATTR via export handle
Allow accessing XATTR through export handle is a very bad idea. It would allow user to write whatever they want in fields where they otherwise could not. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #4828
Diffstat (limited to 'module/zfs/zfs_vfsops.c')
-rw-r--r--module/zfs/zfs_vfsops.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c
index ef04b203d..e05448b9f 100644
--- a/module/zfs/zfs_vfsops.c
+++ b/module/zfs/zfs_vfsops.c
@@ -1540,6 +1540,14 @@ zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp)
ZFS_EXIT(zsb);
return (err);
}
+
+ /* Don't export xattr stuff */
+ if (zp->z_pflags & ZFS_XATTR) {
+ iput(ZTOI(zp));
+ ZFS_EXIT(zsb);
+ return (SET_ERROR(ENOENT));
+ }
+
(void) sa_lookup(zp->z_sa_hdl, SA_ZPL_GEN(zsb), &zp_gen,
sizeof (uint64_t));
zp_gen = zp_gen & gen_mask;