From 89491fafa81c7c4e6aeb8f1a21903bc65b77515e Mon Sep 17 00:00:00 2001 From: Wedson Almeida Filho Date: Sat, 30 Sep 2023 02:00:16 -0300 Subject: gfs2: move gfs2_xattr_handlers_max to .rodata This makes it harder for accidental or malicious changes to gfs2_xattr_handlers_max at runtime. Cc: Bob Peterson Cc: Andreas Gruenbacher Cc: cluster-devel@redhat.com Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-13-wedsonaf@gmail.com Signed-off-by: Christian Brauner --- fs/gfs2/super.h | 4 ++-- fs/gfs2/xattr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'fs/gfs2') diff --git a/fs/gfs2/super.h b/fs/gfs2/super.h index ab9c83106932..b4ddf6244586 100644 --- a/fs/gfs2/super.h +++ b/fs/gfs2/super.h @@ -60,8 +60,8 @@ extern const struct export_operations gfs2_export_ops; extern const struct super_operations gfs2_super_ops; extern const struct dentry_operations gfs2_dops; -extern const struct xattr_handler *gfs2_xattr_handlers_max[]; -extern const struct xattr_handler **gfs2_xattr_handlers_min; +extern const struct xattr_handler * const gfs2_xattr_handlers_max[]; +extern const struct xattr_handler * const *gfs2_xattr_handlers_min; #endif /* __SUPER_DOT_H__ */ diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 4fea70c0fe3d..79d5c5559512 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c @@ -1494,7 +1494,7 @@ static const struct xattr_handler gfs2_xattr_trusted_handler = { .set = gfs2_xattr_set, }; -const struct xattr_handler *gfs2_xattr_handlers_max[] = { +const struct xattr_handler * const gfs2_xattr_handlers_max[] = { /* GFS2_FS_FORMAT_MAX */ &gfs2_xattr_trusted_handler, @@ -1504,4 +1504,4 @@ const struct xattr_handler *gfs2_xattr_handlers_max[] = { NULL, }; -const struct xattr_handler **gfs2_xattr_handlers_min = gfs2_xattr_handlers_max + 1; +const struct xattr_handler * const *gfs2_xattr_handlers_min = gfs2_xattr_handlers_max + 1; -- cgit v1.2.3