Skip to content

Commit 375aa21

Browse files
wedsonafbrauner
authored andcommitted
xfs: move xfs_xattr_handlers to .rodata
This makes it harder for accidental or malicious changes to xfs_xattr_handlers at runtime. Cc: "Darrick J. Wong" <djwong@kernel.org> Cc: linux-xfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20230930050033.41174-27-wedsonaf@gmail.com Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent c25308c commit 375aa21

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/xfs/xfs_xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static const struct xattr_handler xfs_xattr_security_handler = {
175175
.set = xfs_xattr_set,
176176
};
177177

178-
const struct xattr_handler *xfs_xattr_handlers[] = {
178+
const struct xattr_handler * const xfs_xattr_handlers[] = {
179179
&xfs_xattr_user_handler,
180180
&xfs_xattr_trusted_handler,
181181
&xfs_xattr_security_handler,

fs/xfs/xfs_xattr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
int xfs_attr_change(struct xfs_da_args *args);
1010

11-
extern const struct xattr_handler *xfs_xattr_handlers[];
11+
extern const struct xattr_handler * const xfs_xattr_handlers[];
1212

1313
#endif /* __XFS_XATTR_H__ */

0 commit comments

Comments
 (0)