Re: [PATCH 03/29] 9p: move xattr-related structs to .rodata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday, September 30, 2023 7:00:07 AM CEST Wedson Almeida Filho wrote:
> From: Wedson Almeida Filho <walmeida@xxxxxxxxxxxxx>
> 
> This makes it harder for accidental or malicious changes to
> v9fs_xattr_user_handler, v9fs_xattr_trusted_handler,
> v9fs_xattr_security_handler, or v9fs_xattr_handlers at runtime.
> 
> Cc: Eric Van Hensbergen <ericvh@xxxxxxxxxx>
> Cc: Latchesar Ionkov <lucho@xxxxxxxxxx>
> Cc: Dominique Martinet <asmadeus@xxxxxxxxxxxxx>
> Cc: Christian Schoenebeck <linux_oss@xxxxxxxxxxxxx>
> Cc: v9fs@xxxxxxxxxxxxxxx
> Signed-off-by: Wedson Almeida Filho <walmeida@xxxxxxxxxxxxx>

Reviewed-by: Christian Schoenebeck <linux_oss@xxxxxxxxxxxxx>

> ---
>  fs/9p/xattr.c | 8 ++++----
>  fs/9p/xattr.h | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c
> index e00cf8109b3f..053d1cef6e13 100644
> --- a/fs/9p/xattr.c
> +++ b/fs/9p/xattr.c
> @@ -162,27 +162,27 @@ static int v9fs_xattr_handler_set(const struct xattr_handler *handler,
>  	return v9fs_xattr_set(dentry, full_name, value, size, flags);
>  }
>  
> -static struct xattr_handler v9fs_xattr_user_handler = {
> +static const struct xattr_handler v9fs_xattr_user_handler = {
>  	.prefix	= XATTR_USER_PREFIX,
>  	.get	= v9fs_xattr_handler_get,
>  	.set	= v9fs_xattr_handler_set,
>  };
>  
> -static struct xattr_handler v9fs_xattr_trusted_handler = {
> +static const struct xattr_handler v9fs_xattr_trusted_handler = {
>  	.prefix	= XATTR_TRUSTED_PREFIX,
>  	.get	= v9fs_xattr_handler_get,
>  	.set	= v9fs_xattr_handler_set,
>  };
>  
>  #ifdef CONFIG_9P_FS_SECURITY
> -static struct xattr_handler v9fs_xattr_security_handler = {
> +static const struct xattr_handler v9fs_xattr_security_handler = {
>  	.prefix	= XATTR_SECURITY_PREFIX,
>  	.get	= v9fs_xattr_handler_get,
>  	.set	= v9fs_xattr_handler_set,
>  };
>  #endif
>  
> -const struct xattr_handler *v9fs_xattr_handlers[] = {
> +const struct xattr_handler * const v9fs_xattr_handlers[] = {
>  	&v9fs_xattr_user_handler,
>  	&v9fs_xattr_trusted_handler,
>  #ifdef CONFIG_9P_FS_SECURITY
> diff --git a/fs/9p/xattr.h b/fs/9p/xattr.h
> index b5636e544c8a..3ad5a802352a 100644
> --- a/fs/9p/xattr.h
> +++ b/fs/9p/xattr.h
> @@ -10,7 +10,7 @@
>  #include <net/9p/9p.h>
>  #include <net/9p/client.h>
>  
> -extern const struct xattr_handler *v9fs_xattr_handlers[];
> +extern const struct xattr_handler * const v9fs_xattr_handlers[];
>  
>  ssize_t v9fs_fid_xattr_get(struct p9_fid *fid, const char *name,
>  			   void *buffer, size_t buffer_size);
> 





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux