mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kees Cook <keescook@chromium.org>,
	Colin Ian King <colin.king@canonical.com>,
	Christoph Hellwig <hch@lst.de>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: splice() from /dev/zero to a pipe does not work (5.9+)
Date: Fri, 7 May 2021 20:31:32 +0000	[thread overview]
Message-ID: <YJWjpPoJYK6IeF7C@zeniv-ca.linux.org.uk> (raw)
In-Reply-To: <CAHk-=wjhWKp=fQREgQy0uGjo-uvcTg-11gJLoDp4Af8WOKa8ig@mail.gmail.com>

On Fri, May 07, 2021 at 12:29:44PM -0700, Linus Torvalds wrote:
> On Fri, May 7, 2021 at 12:17 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > Umm...  That would do wonders to anything that used to do
> > copy_to_user()/clear_user()/copy_to_user() and got converted
> > to copy_to_iter()/iov_iter_zero()/copy_to_iter()...
> 
> I didn't mean for iov_iter_zero doing this - only splice_read_zero().
> 
> > Are you sure we can shove zero page into pipe, anyway?
> > IIRC, get_page()/put_page() on that is not allowed,
> 
> That's what the
> 
>     buf->ops = &zero_pipe_buf_ops;
> 
> is for. The zero_pipe_buf_ops would have empty get and release
> functions, and a 'steal' function that always returns false.
> 
> That's how the pipe pages are supposed to work: there are people who
> put non-page data (ie things like skbuff allocations etc) into a
> splice pipe buffer. It's why we have those "ops" pointers.

Supposed to - sure, but I'd like to verify that they actually do work
that way before we go there.  Let me RTFS a bit...

  reply	other threads:[~2021-05-07 20:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2add1129-d42e-176d-353d-3aca21280ead@canonical.com>
2021-05-07 18:21 ` Kees Cook
2021-05-07 19:06   ` Linus Torvalds
2021-05-07 19:17     ` Al Viro
2021-05-07 19:29       ` Linus Torvalds
2021-05-07 20:31         ` Al Viro [this message]
2021-05-12 15:13   ` Colin Ian King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJWjpPoJYK6IeF7C@zeniv-ca.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=colin.king@canonical.com \
    --cc=hch@lst.de \
    --cc=johannes@sipsolutions.net \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®