Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <hubcap@omnibond.com>
Cc: Martin Brandenburg <martin@omnibond.com>
Cc: devel@lists.orangefs.org
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-22-wedsonaf@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Wedson Almeida Filho and committed by
Christian Brauner
2e9440ac 2cba9af9

+2 -2
+1 -1
fs/orangefs/orangefs-kernel.h
··· 103 103 #define ORANGEFS_CACHE_CREATE_FLAGS 0 104 104 #endif 105 105 106 - extern const struct xattr_handler *orangefs_xattr_handlers[]; 106 + extern const struct xattr_handler * const orangefs_xattr_handlers[]; 107 107 108 108 extern struct posix_acl *orangefs_get_acl(struct inode *inode, int type, bool rcu); 109 109 extern int orangefs_set_acl(struct mnt_idmap *idmap,
+1 -1
fs/orangefs/xattr.c
··· 554 554 .set = orangefs_xattr_set_default, 555 555 }; 556 556 557 - const struct xattr_handler *orangefs_xattr_handlers[] = { 557 + const struct xattr_handler * const orangefs_xattr_handlers[] = { 558 558 &orangefs_xattr_default_handler, 559 559 NULL 560 560 };