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

Cc: Dave Kleikamp <shaggy@kernel.org>
Cc: jfs-discussion@lists.sourceforge.net
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-17-wedsonaf@gmail.com
Reviewed-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/jfs/jfs_xattr.h
fs/jfs/xattr.c

index 0d33816d251dc3aa18b02c2755681750f31fafd9..ec67d8554d2ca86b928a012ddbaf8e0972ac4d09 100644 (file)
@@ -46,7 +46,7 @@ extern int __jfs_setxattr(tid_t, struct inode *, const char *, const void *,
 extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t);
 extern ssize_t jfs_listxattr(struct dentry *, char *, size_t);
 
-extern const struct xattr_handler *jfs_xattr_handlers[];
+extern const struct xattr_handler * const jfs_xattr_handlers[];
 
 #ifdef CONFIG_JFS_SECURITY
 extern int jfs_init_security(tid_t, struct inode *, struct inode *,
index 8577ad494e056bc7c85cec768ed4ca123b07a85e..0fb7afac298e13b47e1f56d721ed4a4d98ae41d6 100644 (file)
@@ -985,7 +985,7 @@ static const struct xattr_handler jfs_trusted_xattr_handler = {
        .set = jfs_xattr_set,
 };
 
-const struct xattr_handler *jfs_xattr_handlers[] = {
+const struct xattr_handler * const jfs_xattr_handlers[] = {
        &jfs_os2_xattr_handler,
        &jfs_user_xattr_handler,
        &jfs_security_xattr_handler,