ntfs3: move ntfs_xattr_handlers to .rodata
authorWedson Almeida Filho <walmeida@microsoft.com>
Sat, 30 Sep 2023 05:00:23 +0000 (02:00 -0300)
committerChristian Brauner <brauner@kernel.org>
Mon, 9 Oct 2023 14:24:20 +0000 (16:24 +0200)
This makes it harder for accidental or malicious changes to
ntfs_xattr_handlers at runtime.

Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ntfs3@lists.linux.dev
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-20-wedsonaf@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/ntfs3/ntfs_fs.h
fs/ntfs3/xattr.c

index 629403ede6e5f1713cb1f063f354afaa62682c3c..41c1538f8e51c87889ed2e483ee199e120aeeb60 100644 (file)
@@ -872,7 +872,7 @@ int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
 
 int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry);
 ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
-extern const struct xattr_handler *ntfs_xattr_handlers[];
+extern const struct xattr_handler * const ntfs_xattr_handlers[];
 
 int ntfs_save_wsl_perm(struct inode *inode, __le16 *ea_size);
 void ntfs_get_wsl_perm(struct inode *inode);
index 29fd391899e59dfde9b29e920f7303862b7167ff..ffe217160d49c94cb389f07fb691c2ebc0f0afb6 100644 (file)
@@ -1016,7 +1016,7 @@ static const struct xattr_handler ntfs_other_xattr_handler = {
        .list   = ntfs_xattr_user_list,
 };
 
-const struct xattr_handler *ntfs_xattr_handlers[] = {
+const struct xattr_handler * const ntfs_xattr_handlers[] = {
        &ntfs_other_xattr_handler,
        NULL,
 };