From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BDA0E748EE for ; Sun, 1 Oct 2023 16:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235183AbjJAQSx (ORCPT ); Sun, 1 Oct 2023 12:18:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235093AbjJAQSx (ORCPT ); Sun, 1 Oct 2023 12:18:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4229A91; Sun, 1 Oct 2023 09:18:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF1C4C433C7; Sun, 1 Oct 2023 16:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696177130; bh=IJqi20NX4A+8cl63oTYPC78bMfzYE+wujX5yM3GVGE8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YiAIOkII+No95P1D8rRQWljSNLcoio4W+UrsWF+9SnDhIzOSgeAqQ/mhfluo1QWCW lUv1fcut3xe9aNakp8vw8X4Su/fvmbXJ1EmobZB7tUPLSx7ahQGKmy6KLssOgxlHzp c8sKk/KO4hMDaAlgFMpfHF88pb6Bq5R7ITx9zuajdOgC5iCLohgPhiGRcI/JDq12no DkxhdY2Yw1+a8052mmhF3WIk73l1RLKSE1Wf5+fo3hiWLZsUlu+1pyz7wuZSq55Pfs kGRWI+wQEn5eXXddjTago2XRycci8UCNWucv4ELr+TaKe+c2Om1Fhg/Q90bxEaDG+v cVtNgMaJ9xT0Q== Date: Sun, 1 Oct 2023 09:18:50 -0700 From: "Darrick J. Wong" To: Wedson Almeida Filho Cc: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wedson Almeida Filho , linux-xfs@vger.kernel.org Subject: Re: [PATCH 26/29] xfs: move xfs_xattr_handlers to .rodata Message-ID: <20231001161850.GB21298@frogsfrogsfrogs> References: <20230930050033.41174-1-wedsonaf@gmail.com> <20230930050033.41174-27-wedsonaf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230930050033.41174-27-wedsonaf@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Sat, Sep 30, 2023 at 02:00:30AM -0300, Wedson Almeida Filho wrote: > From: Wedson Almeida Filho > > This makes it harder for accidental or malicious changes to > xfs_xattr_handlers at runtime. > > Cc: "Darrick J. Wong" > Cc: linux-xfs@vger.kernel.org > Signed-off-by: Wedson Almeida Filho Reviewed-by: Darrick J. Wong --D > --- > fs/xfs/xfs_xattr.c | 2 +- > fs/xfs/xfs_xattr.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c > index 43e5c219aaed..77418bcd6f3a 100644 > --- a/fs/xfs/xfs_xattr.c > +++ b/fs/xfs/xfs_xattr.c > @@ -175,7 +175,7 @@ static const struct xattr_handler xfs_xattr_security_handler = { > .set = xfs_xattr_set, > }; > > -const struct xattr_handler *xfs_xattr_handlers[] = { > +const struct xattr_handler * const xfs_xattr_handlers[] = { > &xfs_xattr_user_handler, > &xfs_xattr_trusted_handler, > &xfs_xattr_security_handler, > diff --git a/fs/xfs/xfs_xattr.h b/fs/xfs/xfs_xattr.h > index 2b09133b1b9b..cec766cad26c 100644 > --- a/fs/xfs/xfs_xattr.h > +++ b/fs/xfs/xfs_xattr.h > @@ -8,6 +8,6 @@ > > int xfs_attr_change(struct xfs_da_args *args); > > -extern const struct xattr_handler *xfs_xattr_handlers[]; > +extern const struct xattr_handler * const xfs_xattr_handlers[]; > > #endif /* __XFS_XATTR_H__ */ > -- > 2.34.1 >