From: Wedson Almeida Filho Date: Sat, 30 Sep 2023 05:00:31 +0000 (-0300) Subject: overlayfs: move xattr tables to .rodata X-Git-Tag: v6.7-rc1~206^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d649a4a832ecfa48bf1f62972c1ddf0030785d3;p=thirdparty%2Fkernel%2Fstable.git overlayfs: move xattr tables to .rodata This makes it harder for accidental or malicious changes to ovl_trusted_xattr_handlers or ovl_user_xattr_handlers at runtime. Cc: Miklos Szeredi Cc: Amir Goldstein Cc: linux-unionfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-28-wedsonaf@gmail.com Acked-by: Amir Goldstein Signed-off-by: Christian Brauner --- diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index def266b5e2a33..7f67ebfbdae17 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -484,13 +484,13 @@ static const struct xattr_handler ovl_other_xattr_handler = { .set = ovl_other_xattr_set, }; -static const struct xattr_handler *ovl_trusted_xattr_handlers[] = { +static const struct xattr_handler * const ovl_trusted_xattr_handlers[] = { &ovl_own_trusted_xattr_handler, &ovl_other_xattr_handler, NULL }; -static const struct xattr_handler *ovl_user_xattr_handlers[] = { +static const struct xattr_handler * const ovl_user_xattr_handlers[] = { &ovl_own_user_xattr_handler, &ovl_other_xattr_handler, NULL