<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/relay.c, branch v2.6.24</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=v2.6.24</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.24'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2007-10-18T21:37:24Z</updated>
<entry>
<title>whitespace fixes: relayfs</title>
<updated>2007-10-18T21:37:24Z</updated>
<author>
<name>Daniel Walker</name>
<email>dwalker@mvista.com</email>
</author>
<published>2007-10-18T10:06:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1bfbc608ba05951678eedc246c9baf62367764a0'/>
<id>urn:sha1:1bfbc608ba05951678eedc246c9baf62367764a0</id>
<content type='text'>
Signed-off-by: Daniel Walker &lt;dwalker@mvista.com&gt;
Cc: Tom Zanussi &lt;zanussi@us.ibm.com&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>Fix a use after free bug in kernel-&gt;userspace relay file support</title>
<updated>2007-07-31T22:39:42Z</updated>
<author>
<name>Jesper Juhl</name>
<email>jesper.juhl@gmail.com</email>
</author>
<published>2007-07-31T07:39:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c9b3febc5b9c55a76b838c977b078195ec8bb95e'/>
<id>urn:sha1:c9b3febc5b9c55a76b838c977b078195ec8bb95e</id>
<content type='text'>
Coverity spotted what looks like a real possible case of using a variable
after it has been freed.  The problem is in
kernel/relay.c::relay_open_buf()

If the code hits "goto free_buf;" it ends up in this code :

  free_buf:
    	relay_destroy_buf(buf);	&lt;--- calls kfree() on 'buf'.
  free_name:
   	kfree(tmpname);
  end:
  	return buf;		&lt;-- use after free of 'buf'.

I read through the callers and they all handle a NULL return from this
function as an error (and hitting the 'free_buf' label only happens on
failure to chan-&gt;cb-&gt;create_buf_file(), so that looks like a clear error to
me).

The patch simply sets 'buf' to NULL after the call to
relay_destroy_buf(buf); - as far as I can see that should take care of the
problem.

The patch also corrects a reference to a documentation file while
I was at it.

Note from Mathieu: the documentation reference change should have been
done in a separate patch, but I guess no one will really care.

Signed-off-by: Jesper Juhl &lt;jesper.juhl@gmail.com&gt;
Acked-by: "David J. Wilder" &lt;wilder@us.ibm.com&gt;
Tested-by: "David J. Wilder" &lt;wilder@us.ibm.com&gt;
Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@polymtl.ca&gt;
Cc: Tom Zanussi &lt;zanussi@us.ibm.com&gt;
Cc: Karim Yaghmour &lt;karim@opersys.com&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>kernel/relay.c: make functions static</title>
<updated>2007-07-19T17:04:47Z</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@stusta.de</email>
</author>
<published>2007-07-19T08:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=01c55ed3260e130f152b7fbab2e18f23980b59a4'/>
<id>urn:sha1:01c55ed3260e130f152b7fbab2e18f23980b59a4</id>
<content type='text'>
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Cc: Tom Zanussi &lt;zanussi@us.ibm.com&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>relay: fixup kerneldoc comment</title>
<updated>2007-07-13T12:14:28Z</updated>
<author>
<name>Tom Zanussi</name>
<email>zanussi@us.ibm.com</email>
</author>
<published>2007-07-12T06:12:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d3f35d98b3b87d2506289320375687c6e9bc53ed'/>
<id>urn:sha1:d3f35d98b3b87d2506289320375687c6e9bc53ed</id>
<content type='text'>
Change comment from kerneldoc to normal.

Signed-off-by: Tom Zanussi &lt;zanussi@us.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>relay: fix bogus cast in subbuf_splice_actor()</title>
<updated>2007-07-13T12:14:26Z</updated>
<author>
<name>Tom Zanussi</name>
<email>zanussi@us.ibm.com</email>
</author>
<published>2007-07-12T06:12:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=24da24de2eae0c277b85836e2b4b09cfafeea995'/>
<id>urn:sha1:24da24de2eae0c277b85836e2b4b09cfafeea995</id>
<content type='text'>
The current code that sets the read position in subbuf_splice_actor may
give erroneous results if the buffer size isn't a power of 2.  This
patch fixes the problem.

Signed-off-by: Tom Zanussi &lt;zanussi@us.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>pipe: change the -&gt;pin() operation to -&gt;confirm()</title>
<updated>2007-07-10T06:04:15Z</updated>
<author>
<name>Jens Axboe</name>
<email>jens.axboe@oracle.com</email>
</author>
<published>2007-06-14T11:10:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cac36bb06efe4880234524e117e0e712b10b1f16'/>
<id>urn:sha1:cac36bb06efe4880234524e117e0e712b10b1f16</id>
<content type='text'>
The name 'pin' was badly chosen, it doesn't pin a pipe buffer
in the most commonly used sense in the kernel. So change the
name to 'confirm', after debating this issue with Hugh
Dickins a bit.

A good return from -&gt;confirm() means that the buffer is really
there, and that the contents are good.

Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>relay: use splice_to_pipe() instead of open-coding the pipe loop</title>
<updated>2007-07-10T06:04:15Z</updated>
<author>
<name>Jens Axboe</name>
<email>jens.axboe@oracle.com</email>
</author>
<published>2007-06-12T06:43:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1db60cf2056511c7c8cebcbaee308ef6c79b4728'/>
<id>urn:sha1:1db60cf2056511c7c8cebcbaee308ef6c79b4728</id>
<content type='text'>
It cleans up the relay splice implementation a lot, and gets rid of
a lot of internal pipe knowledge that should not be in there.

Plus fixes for padding and partial first page (and lots more) from
Tom Zanussi.

Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>splice: divorce the splice structure/function definitions from the pipe header</title>
<updated>2007-07-10T06:04:14Z</updated>
<author>
<name>Jens Axboe</name>
<email>jens.axboe@oracle.com</email>
</author>
<published>2007-06-04T07:59:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d6b29d7cee064f28ca097e906de7453541351095'/>
<id>urn:sha1:d6b29d7cee064f28ca097e906de7453541351095</id>
<content type='text'>
We need to move even more stuff into the header so that folks can use
the splice_to_pipe() implementation instead of open-coding a lot of
pipe knowledge (see relay implementation), so move to our own header
file finally.

Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>splice: relay support</title>
<updated>2007-07-10T06:04:14Z</updated>
<author>
<name>Tom Zanussi</name>
<email>zanussi@us.ibm.com</email>
</author>
<published>2007-06-04T07:12:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ebf9909343392c929d9943c04f421cd42e03b530'/>
<id>urn:sha1:ebf9909343392c929d9943c04f421cd42e03b530</id>
<content type='text'>
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>relayfs: fix overwrites</title>
<updated>2007-06-28T18:38:18Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>masami.hiramatsu.pt@hitachi.com</email>
</author>
<published>2007-06-27T21:10:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a66e356c04ece4a96f44b942b68234c3de8ec3f5'/>
<id>urn:sha1:a66e356c04ece4a96f44b942b68234c3de8ec3f5</id>
<content type='text'>
When I use relayfs with "overwrite" mode, read() still sets incorrect
number of consumed bytes.

Signed-off-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Acked-by: Tom Zanussi &lt;zanussi@us.ibm.com&gt;
Acked-by: David Wilder &lt;dwilder@us.ibm.com&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>
</feed>
