mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
xfs: don't return XFS_ATTR_PARENT attributes via listxattr
Parent pointers are internal filesystem metadata. They're not intended to be directly visible to userspace, so filter them out of xfs_xattr_put_listent so that they don't appear in listxattr. Signed-off-by: Allison Henderson <allison.henderson@oracle.com> Inspired-by: Andrey Albershteyn <aalbersh@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> [djwong: change this to XFS_ATTR_PRIVATE_NSP_MASK per fsverity patchset] Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
1c12949e50
commit
daf9f88490
@ -726,6 +726,9 @@ struct xfs_attr3_leafblock {
|
|||||||
XFS_ATTR_SECURE | \
|
XFS_ATTR_SECURE | \
|
||||||
XFS_ATTR_PARENT)
|
XFS_ATTR_PARENT)
|
||||||
|
|
||||||
|
/* Private attr namespaces not exposed to userspace */
|
||||||
|
#define XFS_ATTR_PRIVATE_NSP_MASK (XFS_ATTR_PARENT)
|
||||||
|
|
||||||
#define XFS_ATTR_ONDISK_MASK (XFS_ATTR_NSP_ONDISK_MASK | \
|
#define XFS_ATTR_ONDISK_MASK (XFS_ATTR_NSP_ONDISK_MASK | \
|
||||||
XFS_ATTR_LOCAL | \
|
XFS_ATTR_LOCAL | \
|
||||||
XFS_ATTR_INCOMPLETE)
|
XFS_ATTR_INCOMPLETE)
|
||||||
|
@ -229,6 +229,10 @@ xfs_xattr_put_listent(
|
|||||||
|
|
||||||
ASSERT(context->count >= 0);
|
ASSERT(context->count >= 0);
|
||||||
|
|
||||||
|
/* Don't expose private xattr namespaces. */
|
||||||
|
if (flags & XFS_ATTR_PRIVATE_NSP_MASK)
|
||||||
|
return;
|
||||||
|
|
||||||
if (flags & XFS_ATTR_ROOT) {
|
if (flags & XFS_ATTR_ROOT) {
|
||||||
#ifdef CONFIG_XFS_POSIX_ACL
|
#ifdef CONFIG_XFS_POSIX_ACL
|
||||||
if (namelen == SGI_ACL_FILE_SIZE &&
|
if (namelen == SGI_ACL_FILE_SIZE &&
|
||||||
|
Loading…
Reference in New Issue
Block a user