<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/pipe.c, branch v3.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-05-06T21:39:42Z</updated>
<entry>
<title>new helper: copy_page_from_iter()</title>
<updated>2014-05-06T21:39:42Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-04-03T19:05:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0d1bec9d58d4c038d0ac958c9af82be6eb18045'/>
<id>urn:sha1:f0d1bec9d58d4c038d0ac958c9af82be6eb18045</id>
<content type='text'>
parallel to copy_page_to_iter().  pipe_write() switched to it (and became
-&gt;write_iter()).

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>pipe: switch to -&gt;read_iter()</title>
<updated>2014-05-06T21:37:58Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-04-02T23:56:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fb9096a344e2964c6a71520931c08abb1301248e'/>
<id>urn:sha1:fb9096a344e2964c6a71520931c08abb1301248e</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>start adding the tag to iov_iter</title>
<updated>2014-05-06T21:32:49Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-03-06T00:28:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=71d8e532b1549a478e6a6a8a44f309d050294d00'/>
<id>urn:sha1:71d8e532b1549a478e6a6a8a44f309d050294d00</id>
<content type='text'>
For now, just use the same thing we pass to -&gt;direct_IO() - it's all
iovec-based at the moment.  Pass it explicitly to iov_iter_init() and
account for kvec vs. iovec in there, by the same kludge NFS -&gt;direct_IO()
uses.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>switch pipe_read() to copy_page_to_iter()</title>
<updated>2014-04-02T03:19:22Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-02-04T00:11:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=637b58c2887e5e57850865839cc75f59184b23d1'/>
<id>urn:sha1:637b58c2887e5e57850865839cc75f59184b23d1</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>pipe: kill -&gt;map() and -&gt;unmap()</title>
<updated>2014-04-02T03:19:19Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-02-03T02:09:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fbb32750a62df75d1ffea547f3908b21c5496d9f'/>
<id>urn:sha1:fbb32750a62df75d1ffea547f3908b21c5496d9f</id>
<content type='text'>
all pipe_buffer_operations have the same instances of those...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fs/pipe.c: skip file_update_time on frozen fs</title>
<updated>2014-01-24T00:37:00Z</updated>
<author>
<name>Dmitry Monakhov</name>
<email>dmonakhov@openvz.org</email>
</author>
<published>2014-01-23T23:55:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7e775f46a125f894a1d71e96797c776dbec161f0'/>
<id>urn:sha1:7e775f46a125f894a1d71e96797c776dbec161f0</id>
<content type='text'>
Pipe has no data associated with fs so it is not good idea to block
pipe_write() if FS is frozen, but we can not update file's time on such
filesystem.  Let's use same idea as we use in touch_time().

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=65701

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>vfs: fix subtle use-after-free of pipe_inode_info</title>
<updated>2013-12-02T17:44:51Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-12-02T17:44:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0d8d2292160bb63de1972361ebed100c64b5b37'/>
<id>urn:sha1:b0d8d2292160bb63de1972361ebed100c64b5b37</id>
<content type='text'>
The pipe code was trying (and failing) to be very careful about freeing
the pipe info only after the last access, with a pattern like:

        spin_lock(&amp;inode-&gt;i_lock);
        if (!--pipe-&gt;files) {
                inode-&gt;i_pipe = NULL;
                kill = 1;
        }
        spin_unlock(&amp;inode-&gt;i_lock);
        __pipe_unlock(pipe);
        if (kill)
                free_pipe_info(pipe);

where the final freeing is done last.

HOWEVER.  The above is actually broken, because while the freeing is
done at the end, if we have two racing processes releasing the pipe
inode info, the one that *doesn't* free it will decrement the -&gt;files
count, and unlock the inode i_lock, but then still use the
"pipe_inode_info" afterwards when it does the "__pipe_unlock(pipe)".

This is *very* hard to trigger in practice, since the race window is
very small, and adding debug options seems to just hide it by slowing
things down.

Simon originally reported this way back in July as an Oops in
kmem_cache_allocate due to a single bit corruption (due to the final
"spin_unlock(pipe-&gt;mutex.wait_lock)" incrementing a field in a different
allocation that had re-used the free'd pipe-info), it's taken this long
to figure out.

Since the 'pipe-&gt;files' accesses aren't even protected by the pipe lock
(we very much use the inode lock for that), the simple solution is to
just drop the pipe lock early.  And since there were two users of this
pattern, create a helper function for it.

Introduced commit ba5bb147330a ("pipe: take allocation and freeing of
pipe_inode_info out of -&gt;i_mutex").

Reported-by: Simon Kirby &lt;sim@hostway.ca&gt;
Reported-by: Ian Applegate &lt;ia@cloudflare.com&gt;
Acked-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: stable@kernel.org   # v3.10+
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>aio: don't include aio.h in sched.h</title>
<updated>2013-05-08T03:16:25Z</updated>
<author>
<name>Kent Overstreet</name>
<email>koverstreet@google.com</email>
</author>
<published>2013-05-07T23:19:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a27bb332c04cec8c4afd7912df0dc7890db27560'/>
<id>urn:sha1:a27bb332c04cec8c4afd7912df0dc7890db27560</id>
<content type='text'>
Faster kernel compiles by way of fewer unnecessary includes.

[akpm@linux-foundation.org: fix fallout]
[akpm@linux-foundation.org: fix build]
Signed-off-by: Kent Overstreet &lt;koverstreet@google.com&gt;
Cc: Zach Brown &lt;zab@redhat.com&gt;
Cc: Felipe Balbi &lt;balbi@ti.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Mark Fasheh &lt;mfasheh@suse.com&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Asai Thambi S P &lt;asamymuthupa@micron.com&gt;
Cc: Selvan Mani &lt;smani@micron.com&gt;
Cc: Sam Bradshaw &lt;sbradshaw@micron.com&gt;
Cc: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Reviewed-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>get rid of the last free_pipe_info() callers</title>
<updated>2013-04-09T18:13:02Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-03-21T15:06:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b8a8f1e4f94fd87747e6e3acef74cf0b4dc0dae'/>
<id>urn:sha1:4b8a8f1e4f94fd87747e6e3acef74cf0b4dc0dae</id>
<content type='text'>
and rename __free_pipe_info() to free_pipe_info()

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>get rid of alloc_pipe_info() argument</title>
<updated>2013-04-09T18:13:01Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-03-21T15:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7bee130e222dfb3a7a70c0404dc09f104cddd7d6'/>
<id>urn:sha1:7bee130e222dfb3a7a70c0404dc09f104cddd7d6</id>
<content type='text'>
not used anymore

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
