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

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-14-wedsonaf@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/hfs/attr.c
fs/hfs/hfs_fs.h

index 6341bb248247751776a1876630fbb2db15959a0c..f8395cdd1adf873bb3a2ed14dc9f256826c79871 100644 (file)
@@ -146,7 +146,7 @@ static const struct xattr_handler hfs_type_handler = {
        .set = hfs_xattr_set,
 };
 
-const struct xattr_handler *hfs_xattr_handlers[] = {
+const struct xattr_handler * const hfs_xattr_handlers[] = {
        &hfs_creator_handler,
        &hfs_type_handler,
        NULL
index 49d02524e66717a0f9d0c7cd595199a8650e35e6..b5a6ad5df35790c400bc7eb8f7fd13e7ea6a12bf 100644 (file)
@@ -215,7 +215,7 @@ extern void hfs_evict_inode(struct inode *);
 extern void hfs_delete_inode(struct inode *);
 
 /* attr.c */
-extern const struct xattr_handler *hfs_xattr_handlers[];
+extern const struct xattr_handler * const hfs_xattr_handlers[];
 
 /* mdb.c */
 extern int hfs_mdb_get(struct super_block *);