From: Wedson Almeida Filho Date: Sat, 30 Sep 2023 05:00:17 +0000 (-0300) Subject: hfs: move hfs_xattr_handlers to .rodata X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e27a45b6507083f50781a2c94c5f6618a3b916d5;p=linux.git hfs: move hfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to hfs_xattr_handlers at runtime. Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-14-wedsonaf@gmail.com Signed-off-by: Christian Brauner --- diff --git a/fs/hfs/attr.c b/fs/hfs/attr.c index 6341bb2482477..f8395cdd1adf8 100644 --- a/fs/hfs/attr.c +++ b/fs/hfs/attr.c @@ -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 diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h index 49d02524e6671..b5a6ad5df3579 100644 --- a/fs/hfs/hfs_fs.h +++ b/fs/hfs/hfs_fs.h @@ -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 *);