linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 26/29] xfs: move xfs_xattr_handlers to .rodata
       [not found] <20230930050033.41174-1-wedsonaf@gmail.com>
@ 2023-09-30  5:00 ` Wedson Almeida Filho
  2023-10-01 16:18   ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Wedson Almeida Filho @ 2023-09-30  5:00 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, linux-fsdevel
  Cc: linux-kernel, Wedson Almeida Filho, Darrick J. Wong, linux-xfs

From: Wedson Almeida Filho <walmeida@microsoft.com>

This makes it harder for accidental or malicious changes to
xfs_xattr_handlers at runtime.

Cc: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 26/29] xfs: move xfs_xattr_handlers to .rodata
  2023-09-30  5:00 ` [PATCH 26/29] xfs: move xfs_xattr_handlers to .rodata Wedson Almeida Filho
@ 2023-10-01 16:18   ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2023-10-01 16:18 UTC (permalink / raw)
  To: Wedson Almeida Filho
  Cc: Alexander Viro, Christian Brauner, linux-fsdevel, linux-kernel,
	Wedson Almeida Filho, linux-xfs

On Sat, Sep 30, 2023 at 02:00:30AM -0300, Wedson Almeida Filho wrote:
> From: Wedson Almeida Filho <walmeida@microsoft.com>
> 
> This makes it harder for accidental or malicious changes to
> xfs_xattr_handlers at runtime.
> 
> Cc: "Darrick J. Wong" <djwong@kernel.org>
> Cc: linux-xfs@vger.kernel.org
> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-01 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230930050033.41174-1-wedsonaf@gmail.com>
2023-09-30  5:00 ` [PATCH 26/29] xfs: move xfs_xattr_handlers to .rodata Wedson Almeida Filho
2023-10-01 16:18   ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).