Skip to content

Commit c25308c

Browse files
wedsonafbrauner
authored andcommitted
ubifs: move ubifs_xattr_handlers to .rodata
This makes it harder for accidental or malicious changes to ubifs_xattr_handlers at runtime. Cc: Richard Weinberger <richard@nod.at> Cc: linux-mtd@lists.infradead.org Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20230930050033.41174-26-wedsonaf@gmail.com Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent c08a831 commit c25308c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/ubifs/ubifs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ ssize_t ubifs_xattr_get(struct inode *host, const char *name, void *buf,
20432043
size_t size);
20442044

20452045
#ifdef CONFIG_UBIFS_FS_XATTR
2046-
extern const struct xattr_handler *ubifs_xattr_handlers[];
2046+
extern const struct xattr_handler * const ubifs_xattr_handlers[];
20472047
ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size);
20482048
void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum);
20492049
int ubifs_purge_xattrs(struct inode *host);

fs/ubifs/xattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ static const struct xattr_handler ubifs_security_xattr_handler = {
735735
};
736736
#endif
737737

738-
const struct xattr_handler *ubifs_xattr_handlers[] = {
738+
const struct xattr_handler * const ubifs_xattr_handlers[] = {
739739
&ubifs_user_xattr_handler,
740740
&ubifs_trusted_xattr_handler,
741741
#ifdef CONFIG_UBIFS_FS_SECURITY

0 commit comments

Comments
 (0)