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.
This commit is contained in:
parent
25c01919eb
commit
e1249def7d
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user