lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231002094931.yalzcksclq77qjvx@quack3>
Date:   Mon, 2 Oct 2023 11:49:31 +0200
From:   Jan Kara <jack@...e.cz>
To:     Wedson Almeida Filho <wedsonaf@...il.com>
Cc:     Alexander Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <brauner@...nel.org>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        Wedson Almeida Filho <walmeida@...rosoft.com>,
        Jan Kara <jack@...e.com>, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 09/29] ext2: move ext2_xattr_handlers and
 ext2_xattr_handler_map to .rodata

On Sat 30-09-23 02:00:13, Wedson Almeida Filho wrote:
> From: Wedson Almeida Filho <walmeida@...rosoft.com>
> 
> This makes it harder for accidental or malicious changes to
> ext2_xattr_handlers or ext2_xattr_handler_map at runtime.
> 
> Cc: Jan Kara <jack@...e.com>
> Cc: linux-ext4@...r.kernel.org
> Signed-off-by: Wedson Almeida Filho <walmeida@...rosoft.com>

Looks good to me. Feel free to add:

Acked-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/ext2/xattr.c | 4 ++--
>  fs/ext2/xattr.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
> index 8906ba479aaf..cfbe376da612 100644
> --- a/fs/ext2/xattr.c
> +++ b/fs/ext2/xattr.c
> @@ -98,7 +98,7 @@ static struct buffer_head *ext2_xattr_cache_find(struct inode *,
>  static void ext2_xattr_rehash(struct ext2_xattr_header *,
>  			      struct ext2_xattr_entry *);
>  
> -static const struct xattr_handler *ext2_xattr_handler_map[] = {
> +static const struct xattr_handler * const ext2_xattr_handler_map[] = {
>  	[EXT2_XATTR_INDEX_USER]		     = &ext2_xattr_user_handler,
>  #ifdef CONFIG_EXT2_FS_POSIX_ACL
>  	[EXT2_XATTR_INDEX_POSIX_ACL_ACCESS]  = &nop_posix_acl_access,
> @@ -110,7 +110,7 @@ static const struct xattr_handler *ext2_xattr_handler_map[] = {
>  #endif
>  };
>  
> -const struct xattr_handler *ext2_xattr_handlers[] = {
> +const struct xattr_handler * const ext2_xattr_handlers[] = {
>  	&ext2_xattr_user_handler,
>  	&ext2_xattr_trusted_handler,
>  #ifdef CONFIG_EXT2_FS_SECURITY
> diff --git a/fs/ext2/xattr.h b/fs/ext2/xattr.h
> index 7925f596e8e2..6a4966949047 100644
> --- a/fs/ext2/xattr.h
> +++ b/fs/ext2/xattr.h
> @@ -72,7 +72,7 @@ extern void ext2_xattr_delete_inode(struct inode *);
>  extern struct mb_cache *ext2_xattr_create_cache(void);
>  extern void ext2_xattr_destroy_cache(struct mb_cache *cache);
>  
> -extern const struct xattr_handler *ext2_xattr_handlers[];
> +extern const struct xattr_handler * const ext2_xattr_handlers[];
>  
>  # else  /* CONFIG_EXT2_FS_XATTR */
>  
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ