summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWedson Almeida Filho <walmeida@microsoft.com>2023-09-30 08:00:30 +0300
committerChristian Brauner <brauner@kernel.org>2023-10-10 14:49:20 +0300
commit375aa21d36ee8ea19a370da9d38fedcb50ec34d3 (patch)
treededeb10d7628aa584f644eb0c3091e95ecb6d7a8
parentc25308c326dbc304e6f77df0f8f5989a7825203d (diff)
downloadlinux-375aa21d36ee8ea19a370da9d38fedcb50ec34d3.tar.xz
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>
-rw-r--r--fs/xfs/xfs_xattr.c2
-rw-r--r--fs/xfs/xfs_xattr.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index 43e5c219aaed..77418bcd6f3a 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -175,7 +175,7 @@ static const struct xattr_handler xfs_xattr_security_handler = {
.set = xfs_xattr_set,
};
-const struct xattr_handler *xfs_xattr_handlers[] = {
+const struct xattr_handler * const xfs_xattr_handlers[] = {
&xfs_xattr_user_handler,
&xfs_xattr_trusted_handler,
&xfs_xattr_security_handler,
diff --git a/fs/xfs/xfs_xattr.h b/fs/xfs/xfs_xattr.h
index 2b09133b1b9b..cec766cad26c 100644
--- a/fs/xfs/xfs_xattr.h
+++ b/fs/xfs/xfs_xattr.h
@@ -8,6 +8,6 @@
int xfs_attr_change(struct xfs_da_args *args);
-extern const struct xattr_handler *xfs_xattr_handlers[];
+extern const struct xattr_handler * const xfs_xattr_handlers[];
#endif /* __XFS_XATTR_H__ */