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

ntfs3: move ntfs_xattr_handlers to .rodata

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>

authored by

Wedson Almeida Filho and committed by
Christian Brauner
5bf1dd94 f496647e

+2 -2
+1 -1
fs/ntfs3/ntfs_fs.h
··· 872 872 873 873 int ntfs_acl_chmod(struct mnt_idmap *idmap, struct dentry *dentry); 874 874 ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size); 875 - extern const struct xattr_handler *ntfs_xattr_handlers[]; 875 + extern const struct xattr_handler * const ntfs_xattr_handlers[]; 876 876 877 877 int ntfs_save_wsl_perm(struct inode *inode, __le16 *ea_size); 878 878 void ntfs_get_wsl_perm(struct inode *inode);
+1 -1
fs/ntfs3/xattr.c
··· 1016 1016 .list = ntfs_xattr_user_list, 1017 1017 }; 1018 1018 1019 - const struct xattr_handler *ntfs_xattr_handlers[] = { 1019 + const struct xattr_handler * const ntfs_xattr_handlers[] = { 1020 1020 &ntfs_other_xattr_handler, 1021 1021 NULL, 1022 1022 };