summaryrefslogtreecommitdiffstats
path: root/fs/squashfs
diff options
context:
space:
mode:
authorWedson Almeida Filho <walmeida@microsoft.com>2023-09-30 07:00:28 +0200
committerChristian Brauner <brauner@kernel.org>2023-10-10 13:49:20 +0200
commitc08a831c74f040ac332c31ad15254cc7462438bc (patch)
tree04ad2be35ee68afec07a56d2c72154a1628e6add /fs/squashfs
parentsmb: move cifs_xattr_handlers to .rodata (diff)
downloadlinux-c08a831c74f040ac332c31ad15254cc7462438bc.tar.xz
linux-c08a831c74f040ac332c31ad15254cc7462438bc.zip
squashfs: move squashfs_xattr_handlers to .rodata
This makes it harder for accidental or malicious changes to squashfs_xattr_handlers at runtime. Cc: Phillip Lougher <phillip@squashfs.org.uk> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20230930050033.41174-25-wedsonaf@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/squashfs')
-rw-r--r--fs/squashfs/squashfs.h2
-rw-r--r--fs/squashfs/xattr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h
index a6164fdf9435..5a756e6790b5 100644
--- a/fs/squashfs/squashfs.h
+++ b/fs/squashfs/squashfs.h
@@ -111,4 +111,4 @@ extern const struct address_space_operations squashfs_symlink_aops;
extern const struct inode_operations squashfs_symlink_inode_ops;
/* xattr.c */
-extern const struct xattr_handler *squashfs_xattr_handlers[];
+extern const struct xattr_handler * const squashfs_xattr_handlers[];
diff --git a/fs/squashfs/xattr.c b/fs/squashfs/xattr.c
index e1e3f3dd5a06..ce6608cabd49 100644
--- a/fs/squashfs/xattr.c
+++ b/fs/squashfs/xattr.c
@@ -262,7 +262,7 @@ static const struct xattr_handler *squashfs_xattr_handler(int type)
}
}
-const struct xattr_handler *squashfs_xattr_handlers[] = {
+const struct xattr_handler * const squashfs_xattr_handlers[] = {
&squashfs_xattr_user_handler,
&squashfs_xattr_trusted_handler,
&squashfs_xattr_security_handler,