]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ceph: move ceph_xattr_handlers to .rodata
authorWedson Almeida Filho <walmeida@microsoft.com>
Sat, 30 Sep 2023 05:00:10 +0000 (02:00 -0300)
committerChristian Brauner <brauner@kernel.org>
Mon, 9 Oct 2023 14:24:17 +0000 (16:24 +0200)
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>
fs/ceph/super.h
fs/ceph/xattr.c

index 51c7f2b14f6f870f72f9b12dfee211f30b8a9185..98844fc8a2f7af21c53923291bf54fc55b96fa00 100644 (file)
@@ -1119,7 +1119,7 @@ ssize_t __ceph_getxattr(struct inode *, const char *, void *, size_t);
 extern ssize_t ceph_listxattr(struct dentry *, char *, size_t);
 extern struct ceph_buffer *__ceph_build_xattrs_blob(struct ceph_inode_info *ci);
 extern void __ceph_destroy_xattrs(struct ceph_inode_info *ci);
-extern const struct xattr_handler *ceph_xattr_handlers[];
+extern const struct xattr_handler * const ceph_xattr_handlers[];
 
 struct ceph_acl_sec_ctx {
 #ifdef CONFIG_CEPH_FS_POSIX_ACL
index 0deae4a0f5f169b4738019487ca4a25624d3f014..097ce7f74073d4f4ce01b6e7187bce4121a8f050 100644 (file)
@@ -1446,7 +1446,7 @@ void ceph_release_acl_sec_ctx(struct ceph_acl_sec_ctx *as_ctx)
  * List of handlers for synthetic system.* attributes. Other
  * attributes are handled directly.
  */
-const struct xattr_handler *ceph_xattr_handlers[] = {
+const struct xattr_handler * const ceph_xattr_handlers[] = {
        &ceph_other_xattr_handler,
        NULL,
 };