diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-06-22 14:28:52 -0500 |
---|---|---|
committer | Eric Sandeen <sandeen@sandeen.net> | 2022-06-22 14:28:52 -0500 |
commit | 40c3c9f0384ed3d96d2a349937b124b9f0257cde (patch) | |
tree | 3f863ff4e63c510a77e4686b63798a4874ce2432 | |
parent | 52bc85347960b4ea724f04291d3d37df10422e71 (diff) | |
download | xfsprogs-dev-40c3c9f0384ed3d96d2a349937b124b9f0257cde.tar.gz |
xfs: reject unknown xattri log item filter flags during recovery
Source kernel commit: 85d76aec6bbb3dd0131511e73d48b2816e7ab8de
Make sure we screen the "attr flags" field of recovered xattr intent log
items to reject flag bits that we don't know about. This is really the
attr *filter* field from xfs_da_args, so rename the field and create
a mask to make checking for invalid bits easier.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r-- | libxfs/xfs_log_format.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h index f7edd1ecf6..a9d08f3d46 100644 --- a/libxfs/xfs_log_format.h +++ b/libxfs/xfs_log_format.h @@ -912,6 +912,14 @@ struct xfs_icreate_log { #define XFS_ATTR_OP_FLAGS_TYPE_MASK 0xFF /* Flags type mask */ /* + * alfi_attr_filter captures the state of xfs_da_args.attr_filter, so it should + * never have any other bits set. + */ +#define XFS_ATTRI_FILTER_MASK (XFS_ATTR_ROOT | \ + XFS_ATTR_SECURE | \ + XFS_ATTR_INCOMPLETE) + +/* * This is the structure used to lay out an attr log item in the * log. */ @@ -924,7 +932,7 @@ struct xfs_attri_log_format { uint32_t alfi_op_flags; /* marks the op as a set or remove */ uint32_t alfi_name_len; /* attr name length */ uint32_t alfi_value_len; /* attr value length */ - uint32_t alfi_attr_flags;/* attr flags */ + uint32_t alfi_attr_filter;/* attr filter flags */ }; struct xfs_attrd_log_format { |