xattr: make the xattr array itself const
authorWedson Almeida Filho <walmeida@microsoft.com>
Sat, 30 Sep 2023 05:00:05 +0000 (02:00 -0300)
committerChristian Brauner <brauner@kernel.org>
Mon, 9 Oct 2023 14:24:16 +0000 (16:24 +0200)
commite346fb6d774abf1d9a87d39b1e3eef0b7397d154
treeeb5cb0fc0e3f5ad59f501ba0ae7982439721921e
parentce9ecca0238b140b88f43859b211c9fdfd8e5b70
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 <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-2-wedsonaf@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/xattr.c
include/linux/fs.h