From: Wedson Almeida Filho Date: Sat, 30 Sep 2023 05:00:20 +0000 (-0300) Subject: jfs: move jfs_xattr_handlers to .rodata X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ea780283e2c04517ff2e9cdebd0257108aa7f72d;p=linux.git jfs: move jfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to jfs_xattr_handlers at runtime. Cc: Dave Kleikamp Cc: jfs-discussion@lists.sourceforge.net Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-17-wedsonaf@gmail.com Reviewed-by: Dave Kleikamp Signed-off-by: Christian Brauner --- diff --git a/fs/jfs/jfs_xattr.h b/fs/jfs/jfs_xattr.h index 0d33816d251dc..ec67d8554d2ca 100644 --- a/fs/jfs/jfs_xattr.h +++ b/fs/jfs/jfs_xattr.h @@ -46,7 +46,7 @@ extern int __jfs_setxattr(tid_t, struct inode *, const char *, const void *, extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t); extern ssize_t jfs_listxattr(struct dentry *, char *, size_t); -extern const struct xattr_handler *jfs_xattr_handlers[]; +extern const struct xattr_handler * const jfs_xattr_handlers[]; #ifdef CONFIG_JFS_SECURITY extern int jfs_init_security(tid_t, struct inode *, struct inode *, diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 8577ad494e056..0fb7afac298e1 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -985,7 +985,7 @@ static const struct xattr_handler jfs_trusted_xattr_handler = { .set = jfs_xattr_set, }; -const struct xattr_handler *jfs_xattr_handlers[] = { +const struct xattr_handler * const jfs_xattr_handlers[] = { &jfs_os2_xattr_handler, &jfs_user_xattr_handler, &jfs_security_xattr_handler,