From: Wedson Almeida Filho Date: Sat, 30 Sep 2023 05:00:09 +0000 (-0300) Subject: btrfs: move btrfs_xattr_handlers to .rodata X-Git-Tag: v6.7-rc1~206^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a25b4189896411136fcce5f271673f6239725ba;p=thirdparty%2Fkernel%2Fstable.git btrfs: move btrfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to btrfs_xattr_handlers at runtime. Cc: Chris Mason Cc: Josef Bacik Cc: David Sterba Cc: linux-btrfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-6-wedsonaf@gmail.com Signed-off-by: Christian Brauner --- diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 96828a13dd43d..a9f8b173a99f0 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -442,7 +442,7 @@ static const struct xattr_handler btrfs_btrfs_xattr_handler = { .set = btrfs_xattr_handler_set_prop, }; -const struct xattr_handler *btrfs_xattr_handlers[] = { +const struct xattr_handler * const btrfs_xattr_handlers[] = { &btrfs_security_xattr_handler, &btrfs_trusted_xattr_handler, &btrfs_user_xattr_handler, diff --git a/fs/btrfs/xattr.h b/fs/btrfs/xattr.h index 1cd3fc0a8f178..118118ca3e1de 100644 --- a/fs/btrfs/xattr.h +++ b/fs/btrfs/xattr.h @@ -8,7 +8,7 @@ #include -extern const struct xattr_handler *btrfs_xattr_handlers[]; +extern const struct xattr_handler * const btrfs_xattr_handlers[]; int btrfs_getxattr(struct inode *inode, const char *name, void *buffer, size_t size);