Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1557220

Re: [PATCH RESEND] splice: introduce FMODE_SPLICE_READ and FMODE_SPLICE_WRITE

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH RESEND] splice: introduce FMODE_SPLICE_READ and FMODE_SPLICE_WRITE
Date 2017-01-12 10:20 +0100
Message-ID <sYJI5-2bd-1@gated-at.bofh.it> (permalink)
References <sYnRf-5iP-23@gated-at.bofh.it> <sYqcq-6Ty-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jan 11, 2017 at 07:20:13AM -0500, Jeff Layton wrote:
> On Wed, 2017-01-11 at 10:51 +0100, Johannes Thumshirn wrote:
> > Introduce FMODE_SPLICE_READ and FMODE_SPLICE_WRITE. These modes check
> > whether it is legal to read or write a file using splice. Both get
> > automatically set on regular files and are not checked when a 'struct
> > fileoperations' includes the splice_{read,write} methods.
> > 
> 
> Could you add a description of the problem that this solves? I assume
> you hit a problem trying to splice to/from a non-regular file, but it'd
> be good to know what that problem was.

Insane ->write() instances, basically.  I'm not at all convinced that it's
a good idea - sure, we can go and mark sane ones as such one-by-one, but
it's a _lot_ of code churn and insane ones are very few.  Moreover, I would
argue that the right way to handle that is to reject any new instances of
that insanity - splice or no splice, write(2) that includes userland pointers
in payload and dereferences them is not fit to live.  /dev/sg, /dev/bsg
and infinibarf are examples of really bad APIs; sure, we can't kill them
off (at least /dev/sg is used by a bunch of userland programs and all of
them expect that semantics), but that doesn't excuse any new drivers trying
to introduce the same.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH RESEND] splice: introduce FMODE_SPLICE_READ and FMODE_SPLICE_WRITE Johannes Thumshirn <jthumshirn@suse.de> - 2017-01-11 11:00 +0100
  Re: [PATCH RESEND] splice: introduce FMODE_SPLICE_READ and  FMODE_SPLICE_WRITE Jeff Layton <jlayton@redhat.com> - 2017-01-11 13:30 +0100
    Re: [PATCH RESEND] splice: introduce FMODE_SPLICE_READ and  FMODE_SPLICE_WRITE Johannes Thumshirn <jthumshirn@suse.de> - 2017-01-11 14:10 +0100
    Re: [PATCH RESEND] splice: introduce FMODE_SPLICE_READ and  FMODE_SPLICE_WRITE Al Viro <viro@ZenIV.linux.org.uk> - 2017-01-12 10:20 +0100

csiph-web