diff options
| author | Wedson Almeida Filho <[email protected]> | 2023-09-30 02:00:05 -0300 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2023-10-09 16:24:16 +0200 |
| commit | e346fb6d774abf1d9a87d39b1e3eef0b7397d154 (patch) | |
| tree | eb5cb0fc0e3f5ad59f501ba0ae7982439721921e /include/linux | |
| parent | ce9ecca0238b140b88f43859b211c9fdfd8e5b70 (diff) | |
xattr: make the xattr array itself const
As it is currently declared, the xattr_handler structs are const but the
array containing their pointers is not. This patch makes it so that fs
modules can place them in .rodata, which makes it harder for
accidental/malicious modifications at runtime.
Signed-off-by: Wedson Almeida Filho <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4aeb3fa11927..bba22e25664d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1206,7 +1206,7 @@ struct super_block { #ifdef CONFIG_SECURITY void *s_security; #endif - const struct xattr_handler **s_xattr; + const struct xattr_handler * const *s_xattr; #ifdef CONFIG_FS_ENCRYPTION const struct fscrypt_operations *s_cop; struct fscrypt_keyring *s_master_keys; /* master crypto keys in use */ |