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

ecryptfs: move ecryptfs_xattr_handlers to .rodata

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>

authored by

Wedson Almeida Filho and committed by
Christian Brauner
f354ed98 10f9fbe9

+2 -2
+1 -1
fs/ecryptfs/ecryptfs_kernel.h
··· 702 702 int ecryptfs_derive_iv(char *iv, struct ecryptfs_crypt_stat *crypt_stat, 703 703 loff_t offset); 704 704 705 - extern const struct xattr_handler *ecryptfs_xattr_handlers[]; 705 + extern const struct xattr_handler * const ecryptfs_xattr_handlers[]; 706 706 707 707 #endif /* #ifndef ECRYPTFS_KERNEL_H */
+1 -1
fs/ecryptfs/inode.c
··· 1210 1210 .set = ecryptfs_xattr_set, 1211 1211 }; 1212 1212 1213 - const struct xattr_handler *ecryptfs_xattr_handlers[] = { 1213 + const struct xattr_handler * const ecryptfs_xattr_handlers[] = { 1214 1214 &ecryptfs_xattr_handler, 1215 1215 NULL 1216 1216 };