From: Allison Henderson Date: Mon, 29 Jul 2024 23:22:48 +0000 (-0700) Subject: xfs: don't return XFS_ATTR_PARENT attributes via listxattr X-Git-Tag: v6.10.0~24^2~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7aa234805b88faf26d3c0f1230b0a65ff86410f3;p=thirdparty%2Fxfsprogs-dev.git xfs: don't return XFS_ATTR_PARENT attributes via listxattr Source kernel commit: daf9f884906bcfcffe26967aee9ece893fba019b 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 Inspired-by: Andrey Albershteyn Reviewed-by: Darrick J. Wong [djwong: change this to XFS_ATTR_PRIVATE_NSP_MASK per fsverity patchset] Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/xfs_da_format.h b/libxfs/xfs_da_format.h index 1395ad19..ebde6eb1 100644 --- a/libxfs/xfs_da_format.h +++ b/libxfs/xfs_da_format.h @@ -726,6 +726,9 @@ struct xfs_attr3_leafblock { XFS_ATTR_SECURE | \ 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 | \ XFS_ATTR_LOCAL | \ XFS_ATTR_INCOMPLETE)