Unverified Commit ce78a1ec authored by Wedson Almeida Filho's avatar Wedson Almeida Filho Committed by Christian Brauner
Browse files

ext2: move ext2_xattr_handlers and ext2_xattr_handler_map to .rodata



This makes it harder for accidental or malicious changes to
ext2_xattr_handlers or ext2_xattr_handler_map at runtime.

Cc: Jan Kara <jack@suse.com>
Cc: linux-ext4@vger.kernel.org
Signed-off-by: default avatarWedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230930050033.41174-10-wedsonaf@gmail.com


Acked-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 3591f40e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ static struct buffer_head *ext2_xattr_cache_find(struct inode *,
static void ext2_xattr_rehash(struct ext2_xattr_header *,
			      struct ext2_xattr_entry *);

static const struct xattr_handler *ext2_xattr_handler_map[] = {
static const struct xattr_handler * const ext2_xattr_handler_map[] = {
	[EXT2_XATTR_INDEX_USER]		     = &ext2_xattr_user_handler,
#ifdef CONFIG_EXT2_FS_POSIX_ACL
	[EXT2_XATTR_INDEX_POSIX_ACL_ACCESS]  = &nop_posix_acl_access,
@@ -110,7 +110,7 @@ static const struct xattr_handler *ext2_xattr_handler_map[] = {
#endif
};

const struct xattr_handler *ext2_xattr_handlers[] = {
const struct xattr_handler * const ext2_xattr_handlers[] = {
	&ext2_xattr_user_handler,
	&ext2_xattr_trusted_handler,
#ifdef CONFIG_EXT2_FS_SECURITY
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ extern void ext2_xattr_delete_inode(struct inode *);
extern struct mb_cache *ext2_xattr_create_cache(void);
extern void ext2_xattr_destroy_cache(struct mb_cache *cache);

extern const struct xattr_handler *ext2_xattr_handlers[];
extern const struct xattr_handler * const ext2_xattr_handlers[];

# else  /* CONFIG_EXT2_FS_XATTR */