gfs2: move gfs2_xattr_handlers_max to .rodata
authorWedson Almeida Filho <walmeida@microsoft.com>
Sat, 30 Sep 2023 05:00:16 +0000 (02:00 -0300)
committerChristian Brauner <brauner@kernel.org>
Mon, 9 Oct 2023 14:24:18 +0000 (16:24 +0200)
This makes it harder for accidental or malicious changes to
gfs2_xattr_handlers_max at runtime.

Cc: Bob Peterson <rpeterso@redhat.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Cc: cluster-devel@redhat.com
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-13-wedsonaf@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/gfs2/super.h
fs/gfs2/xattr.c

index ab9c83106932db17dd247d795bbf774b53899004..b4ddf624458656dc078cc1aa52090cb60882dd5c 100644 (file)
@@ -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__ */
 
index 4fea70c0fe3d17f1059e216888ecd470452cac68..79d5c55595121d1e08bfe81263f79cb7f982c34c 100644 (file)
@@ -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;