summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-06-01 02:42:18 +0000
committerrwatson <rwatson@FreeBSD.org>2003-06-01 02:42:18 +0000
commit1963dd0ba4507fce4c9834e3f01aafa8b425645c (patch)
treeaf513916400d5c01eea1c3e5c38e2a47b0a9a688 /sys/ufs
parent9e4887bad8511156504cb280a4cdf4549c7a8487 (diff)
downloadFreeBSD-src-1963dd0ba4507fce4c9834e3f01aafa8b425645c.zip
FreeBSD-src-1963dd0ba4507fce4c9834e3f01aafa8b425645c.tar.gz
Return EOPNOTSUPP for attempted EA operations on VCHR vnodes in UFS2;
if we permit them to occur, the kernel panics due to our performing EA operations using VOP_STRATEGY on the vnode. This went unnoticed previously because there are very for users of device nodes on UFS2 due to the introduction of devfs. However, this can come up with the Linux compat directories and its hard-coded dev nodes (which will need to go away as we move away from hard-coded device numbers). This can come up if you use EA-intensive features such as ACLs and MAC. The proper fix is pretty complicated, but this band-aid would be an excellent MFC candidate for the release.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vnops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index a0fd9f0..ab716c9 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1409,6 +1409,10 @@ struct vop_openextattr_args {
fs = ip->i_fs;
if (fs->fs_magic == FS_UFS1_MAGIC)
return (ufs_vnoperate((struct vop_generic_args *)ap));
+
+ if (ap->a_vp->v_type == VCHR)
+ return (EOPNOTSUPP);
+
return (ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td));
}
@@ -1435,6 +1439,10 @@ struct vop_closeextattr_args {
fs = ip->i_fs;
if (fs->fs_magic == FS_UFS1_MAGIC)
return (ufs_vnoperate((struct vop_generic_args *)ap));
+
+ if (ap->a_vp->v_type == VCHR)
+ return (EOPNOTSUPP);
+
return (ffs_close_ea(ap->a_vp, ap->a_commit, ap->a_cred, ap->a_td));
}
@@ -1470,6 +1478,9 @@ vop_getextattr {
if (fs->fs_magic == FS_UFS1_MAGIC)
return (ufs_vnoperate((struct vop_generic_args *)ap));
+ if (ap->a_vp->v_type == VCHR)
+ return (EOPNOTSUPP);
+
error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace,
ap->a_cred, ap->a_td, IREAD);
if (error)
@@ -1553,6 +1564,9 @@ vop_setextattr {
if (fs->fs_magic == FS_UFS1_MAGIC)
return (ufs_vnoperate((struct vop_generic_args *)ap));
+ if (ap->a_vp->v_type == VCHR)
+ return (EOPNOTSUPP);
+
error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace,
ap->a_cred, ap->a_td, IWRITE);
if (error) {
OpenPOWER on IntegriCloud