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]
Date:   Wed, 30 Aug 2017 18:35:41 +0300
From:   Nikolay Borisov <nborisov@...e.com>
To:     Christoph Hellwig <hch@....de>, viro@...iv.linux.org.uk
Cc:     arve@...roid.com, riandrews@...roid.com,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/16] btrfs: switch write_buf to kernel_write



On 30.08.2017 18:00, Christoph Hellwig wrote:
> Instead of playing with the addressing limits.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---

Reviewed-by: Nikolay Borisov <nborisov@...e.com>

>  fs/btrfs/send.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
> index b082210df9c8..24b989fd130c 100644
> --- a/fs/btrfs/send.c
> +++ b/fs/btrfs/send.c
> @@ -539,33 +539,23 @@ static struct btrfs_path *alloc_path_for_send(void)
>  static int write_buf(struct file *filp, const void *buf, u32 len, loff_t *off)
>  {
>  	int ret;
> -	mm_segment_t old_fs;
>  	u32 pos = 0;
>  
> -	old_fs = get_fs();
> -	set_fs(KERNEL_DS);
> -
>  	while (pos < len) {
> -		ret = vfs_write(filp, (__force const char __user *)buf + pos,
> -				len - pos, off);
> +		ret = kernel_write(filp, buf + pos, len - pos, off);
>  		/* TODO handle that correctly */
>  		/*if (ret == -ERESTARTSYS) {
>  			continue;
>  		}*/
>  		if (ret < 0)
> -			goto out;
> +			return ret;
>  		if (ret == 0) {
> -			ret = -EIO;
> -			goto out;
> +			return -EIO;
>  		}
>  		pos += ret;
>  	}
>  
> -	ret = 0;
> -
> -out:
> -	set_fs(old_fs);
> -	return ret;
> +	return 0;
>  }
>  
>  static int tlv_put(struct send_ctx *sctx, u16 attr, const void *data, int len)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ