]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ecryptfs: move ecryptfs_xattr_handlers to .rodata
authorWedson Almeida Filho <walmeida@microsoft.com>
Sat, 30 Sep 2023 05:00:11 +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
ecryptfs_xattr_handlers at runtime.

Cc: Tyler Hicks <code@tyhicks.com>
Cc: ecryptfs@vger.kernel.org
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-8-wedsonaf@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/inode.c

index f2ed0c0266cb7d455b95f9d453737bc4222f1804..c586c5db18b5e5e3224bc0c828690cfb0901cf8d 100644 (file)
@@ -702,6 +702,6 @@ int ecryptfs_set_f_namelen(long *namelen, long lower_namelen,
 int ecryptfs_derive_iv(char *iv, struct ecryptfs_crypt_stat *crypt_stat,
                       loff_t offset);
 
-extern const struct xattr_handler *ecryptfs_xattr_handlers[];
+extern const struct xattr_handler * const ecryptfs_xattr_handlers[];
 
 #endif /* #ifndef ECRYPTFS_KERNEL_H */
index 992d9c7e64ae66f2cb094d949653e693a325c4b6..a25dd3d20008bfa40d2fc81b797f4dfa3f9118db 100644 (file)
@@ -1210,7 +1210,7 @@ static const struct xattr_handler ecryptfs_xattr_handler = {
        .set = ecryptfs_xattr_set,
 };
 
-const struct xattr_handler *ecryptfs_xattr_handlers[] = {
+const struct xattr_handler * const ecryptfs_xattr_handlers[] = {
        &ecryptfs_xattr_handler,
        NULL
 };