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 <david.chen@osnexus.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #4828
This commit is contained in:
parent
af4e50750b
commit
2ab9247411
|
@ -1614,6 +1614,14 @@ zfs_vget(struct super_block *sb, struct inode **ipp, fid_t *fidp)
|
||||||
ZFS_EXIT(zsb);
|
ZFS_EXIT(zsb);
|
||||||
return (err);
|
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,
|
(void) sa_lookup(zp->z_sa_hdl, SA_ZPL_GEN(zsb), &zp_gen,
|
||||||
sizeof (uint64_t));
|
sizeof (uint64_t));
|
||||||
zp_gen = zp_gen & gen_mask;
|
zp_gen = zp_gen & gen_mask;
|
||||||
|
|
Loading…
Reference in New Issue