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

ceph: move ceph_xattr_handlers to .rodata

This makes it harder for accidental or malicious changes to
ceph_xattr_handlers at runtime.

Cc: Xiubo Li <xiubli@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: ceph-devel@vger.kernel.org
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-7-wedsonaf@gmail.com
Acked-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Wedson Almeida Filho and committed by
Christian Brauner
10f9fbe9 8a25b418

+2 -2
+1 -1
fs/ceph/super.h
··· 1119 1119 extern ssize_t ceph_listxattr(struct dentry *, char *, size_t); 1120 1120 extern struct ceph_buffer *__ceph_build_xattrs_blob(struct ceph_inode_info *ci); 1121 1121 extern void __ceph_destroy_xattrs(struct ceph_inode_info *ci); 1122 - extern const struct xattr_handler *ceph_xattr_handlers[]; 1122 + extern const struct xattr_handler * const ceph_xattr_handlers[]; 1123 1123 1124 1124 struct ceph_acl_sec_ctx { 1125 1125 #ifdef CONFIG_CEPH_FS_POSIX_ACL
+1 -1
fs/ceph/xattr.c
··· 1446 1446 * List of handlers for synthetic system.* attributes. Other 1447 1447 * attributes are handled directly. 1448 1448 */ 1449 - const struct xattr_handler *ceph_xattr_handlers[] = { 1449 + const struct xattr_handler * const ceph_xattr_handlers[] = { 1450 1450 &ceph_other_xattr_handler, 1451 1451 NULL, 1452 1452 };