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: <E1OHDru-0000Ge-Lr@pomaz-ex.szeredi.hu>
Date:	Wed, 26 May 2010 12:29:46 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	Changli Gao <xiaosuo@...il.com>
CC:	viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, xiaosuo@...il.com
Subject: Re: [PATCH 2/3] splice: allow non-block splice only when in file is seekable

On Wed, 26 May 2010, Changli Gao wrote:
> allow non-block splice only when in file is seekable.
> 
> do_splice_to() is split to two parts: read data from in file to spd, and move
> data from spd to pipe. If there isn't much space in pipe for the data in spd,
> and the splice is called with non-block flag, the data dropped due to non
> enough space in pipe will be lost forever when in file isn't seekable.

This is a gratuitous ABI change.  I don't think we should hold the
hand of application writers, maybe they _know_ the splice will not
block.

NACK from me.

Miklos

> 
> Signed-off-by: Changli Gao <xiaosuo@...il.com>
> ----
>  fs/splice.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> diff --git a/fs/splice.c b/fs/splice.c
> index 9e52de5..8137e23 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -1346,8 +1346,12 @@ static long do_splice(struct file *in, loff_t __user *off_in,
>  			if (copy_from_user(&offset, off_in, sizeof(loff_t)))
>  				return -EFAULT;
>  			off = &offset;
> -		} else
> +		} else {
> +			if ((flags & SPLICE_F_NONBLOCK) &&
> +			    !(in->f_mode & FMODE_PREAD))
> +				return -EINVAL;
>  			off = &in->f_pos;
> +		}
>  
>  		ret = do_splice_to(in, off, opipe, len, flags);
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ