From: Wedson Almeida Filho Date: Sat, 30 Sep 2023 05:00:25 +0000 (-0300) Subject: orangefs: move orangefs_xattr_handlers to .rodata X-Git-Tag: io_uring-6.7-2023-11-10~124^2~9 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=2e9440ac07169790df74dcab412a945c2bfb78f2;p=linux-block.git orangefs: move orangefs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to orangefs_xattr_handlers at runtime. Cc: Mike Marshall Cc: Martin Brandenburg Cc: devel@lists.orangefs.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-22-wedsonaf@gmail.com Signed-off-by: Christian Brauner --- diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index b711654ca18a..926d9c0a428a 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -103,7 +103,7 @@ enum orangefs_vfs_op_states { #define ORANGEFS_CACHE_CREATE_FLAGS 0 #endif -extern const struct xattr_handler *orangefs_xattr_handlers[]; +extern const struct xattr_handler * const orangefs_xattr_handlers[]; extern struct posix_acl *orangefs_get_acl(struct inode *inode, int type, bool rcu); extern int orangefs_set_acl(struct mnt_idmap *idmap, diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index 68b62689a63e..74ef75586f38 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c @@ -554,7 +554,7 @@ static const struct xattr_handler orangefs_xattr_default_handler = { .set = orangefs_xattr_set_default, }; -const struct xattr_handler *orangefs_xattr_handlers[] = { +const struct xattr_handler * const orangefs_xattr_handlers[] = { &orangefs_xattr_default_handler, NULL };