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] [day] [month] [year] [list]
Message-ID: <20180110184141.GA18352@jaegeuk-macbookpro.roam.corp.google.com>
Date:   Wed, 10 Jan 2018 10:41:41 -0800
From:   Jaegeuk Kim <jaegeuk@...nel.org>
To:     Chao Yu <yuchao0@...wei.com>
Cc:     linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org, chao@...nel.org
Subject: Re: [PATCH] f2fs: fix to cover f2fs_fiemap with inode_lock

On 01/10, Chao Yu wrote:
> This patch fix to cover f2fs_fiemap with inode_lock in order to make
> the whole interface avoiding race with mapping change.
> 
> Signed-off-by: Chao Yu <yuchao0@...wei.com>
> ---
>  fs/f2fs/data.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index d6302051a65d..330085d3adfc 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -1146,18 +1146,18 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
>  	u32 flags = 0;
>  	int ret = 0;
>  
> +	inode_lock(inode);
> +
>  	ret = fiemap_check_flags(fieinfo, FIEMAP_FLAG_SYNC);
>  	if (ret)
> -		return ret;
> +		goto out;

Uh? We don't need to cover fiemap_check_flags() by inode_lock().

>  
>  	if (f2fs_has_inline_data(inode)) {
>  		ret = f2fs_inline_data_fiemap(inode, fieinfo, start, len);
>  		if (ret != -EAGAIN)
> -			return ret;
> +			goto out;
>  	}
>  
> -	inode_lock(inode);
> -
>  	if (logical_to_blk(inode, len) == 0)
>  		len = blk_to_logical(inode, 1);
>  
> -- 
> 2.15.0.55.gc2ece9dc4de6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ