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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181018214517.GA44581@t480s.mkb.name>
Date:   Thu, 18 Oct 2018 17:45:17 -0400
From:   martin@...ibond.com
To:     Miklos Szeredi <mszeredi@...hat.com>
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-api@...r.kernel.org, David Howells <dhowells@...hat.com>,
        Michael Kerrisk <mtk.manpages@...il.com>,
        Andreas Dilger <adilger@...ger.ca>,
        Florian Weimer <fw@...eb.enyo.de>,
        Amir Goldstein <amir73il@...il.com>,
        Mike Marshall <hubcap@...ibond.com>
Subject: Re: [PATCH 1/3] orangefs: fix request_mask misuse

On Thu, Oct 18, 2018 at 03:11:23PM +0200, Miklos Szeredi wrote:
> Orangefs only handles STATX_BASIC_STATS in its getattr implementation, so
> mask off all other flags.  Not doing so results in statx(2) forcing a
> refresh of cached attributes on any other requested flag (i.e. STATX_BTIME
> currently) due to the following test in orangefs_inode_getattr():
> 
>   (request_mask & orangefs_inode->getattr_mask) == request_mask
> 
> Also clean up gratuitous uses of STATX_ALL.
> 
> Signed-off-by: Miklos Szeredi <mszeredi@...hat.com>
> Cc: Mike Marshall <hubcap@...ibond.com>
> Cc: Martin Brandenburg <martin@...ibond.com>

Reviewed-by: Martin Brandenburg <martin@...ibond.com>

> ---
>  fs/orangefs/inode.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
> index 31932879b716..bd7f15a831dc 100644
> --- a/fs/orangefs/inode.c
> +++ b/fs/orangefs/inode.c
> @@ -256,7 +256,8 @@ int orangefs_getattr(const struct path *path, struct kstat *stat,
>  		     "orangefs_getattr: called on %pd\n",
>  		     path->dentry);
>  
> -	ret = orangefs_inode_getattr(inode, 0, 0, request_mask);
> +	ret = orangefs_inode_getattr(inode, 0, 0,
> +				     request_mask & STATX_BASIC_STATS);
>  	if (ret == 0) {
>  		generic_fillattr(inode, stat);
>  
> @@ -408,7 +409,7 @@ struct inode *orangefs_iget(struct super_block *sb,
>  	if (!inode || !(inode->i_state & I_NEW))
>  		return inode;
>  
> -	error = orangefs_inode_getattr(inode, 1, 1, STATX_ALL);
> +	error = orangefs_inode_getattr(inode, 1, 1, STATX_BASIC_STATS);
>  	if (error) {
>  		iget_failed(inode);
>  		return ERR_PTR(error);
> @@ -453,7 +454,7 @@ struct inode *orangefs_new_inode(struct super_block *sb, struct inode *dir,
>  	orangefs_set_inode(inode, ref);
>  	inode->i_ino = hash;	/* needed for stat etc */
>  
> -	error = orangefs_inode_getattr(inode, 1, 1, STATX_ALL);
> +	error = orangefs_inode_getattr(inode, 1, 1, STATX_BASIC_STATS);
>  	if (error)
>  		goto out_iput;
>  
> -- 
> 2.14.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ