<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/sunrpc, branch v2.6.18.3</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>[PATCH] knfsd: Fix race that can disable NFS server.</title>
<updated>2006-11-04T01:33:47+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2006-10-20T01:52:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=02bb8f3f912d8a2048ed7502a733f64c6bf8fcfe'/>
<id>02bb8f3f912d8a2048ed7502a733f64c6bf8fcfe</id>
<content type='text'>
This is a long standing bug that seems to have only recently become
apparent, presumably due to increasing use of NFS over TCP - many
distros seem to be making it the default.

The SK_CONN bit gets set when a listening socket may be ready
for an accept, just as SK_DATA is set when data may be available.

It is entirely possible for svc_tcp_accept to be called with neither
of these set.  It doesn't happen often but there is a small race in
svc_sock_enqueue as SK_CONN and SK_DATA are tested outside the
spin_lock.  They could be cleared immediately after the test and
before the lock is gained.

This normally shouldn't be a problem.  The sockets are non-blocking so
trying to read() or accept() when ther is nothing to do is not a problem.

However: svc_tcp_recvfrom makes the decision "Should I accept() or
should I read()" based on whether SK_CONN is set or not.  This usually
works but is not safe.  The decision should be based on whether it is
a TCP_LISTEN socket or a TCP_CONNECTED socket.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Chris Wright &lt;chrisw@sous-sol.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a long standing bug that seems to have only recently become
apparent, presumably due to increasing use of NFS over TCP - many
distros seem to be making it the default.

The SK_CONN bit gets set when a listening socket may be ready
for an accept, just as SK_DATA is set when data may be available.

It is entirely possible for svc_tcp_accept to be called with neither
of these set.  It doesn't happen often but there is a small race in
svc_sock_enqueue as SK_CONN and SK_DATA are tested outside the
spin_lock.  They could be cleared immediately after the test and
before the lock is gained.

This normally shouldn't be a problem.  The sockets are non-blocking so
trying to read() or accept() when ther is nothing to do is not a problem.

However: svc_tcp_recvfrom makes the decision "Should I accept() or
should I read()" based on whether SK_CONN is set or not.  This usually
works but is not safe.  The decision should be based on whether it is
a TCP_LISTEN socket or a TCP_CONNECTED socket.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Chris Wright &lt;chrisw@sous-sol.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>NFS: Check lengths more thoroughly in NFS4 readdir XDR decode</title>
<updated>2006-08-24T19:53:34+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-08-24T19:44:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e8896495bca8490a427409e0886d63d05419ec65'/>
<id>e8896495bca8490a427409e0886d63d05419ec65</id>
<content type='text'>
Check the bounds of length specifiers more thoroughly in the XDR decoding of
NFS4 readdir reply data.

Currently, if the server returns a bitmap or attr length that causes the
current decode point pointer to wrap, this could go undetected (consider a
small "negative" length on a 32-bit machine).

Also add a check into the main XDR decode handler to make sure that the amount
of data is a multiple of four bytes (as specified by RFC-1014).  This makes
sure that we can do u32* pointer subtraction in the NFS client without risking
an undefined result (the result is undefined if the pointers are not correctly
aligned with respect to one another).

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 5861fddd64a7eaf7e8b1a9997455a24e7f688092 commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check the bounds of length specifiers more thoroughly in the XDR decoding of
NFS4 readdir reply data.

Currently, if the server returns a bitmap or attr length that causes the
current decode point pointer to wrap, this could go undetected (consider a
small "negative" length on a 32-bit machine).

Also add a check into the main XDR decode handler to make sure that the amount
of data is a multiple of four bytes (as specified by RFC-1014).  This makes
sure that we can do u32* pointer subtraction in the NFS client without risking
an undefined result (the result is undefined if the pointers are not correctly
aligned with respect to one another).

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 5861fddd64a7eaf7e8b1a9997455a24e7f688092 commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>SUNRPC: Fix dentry refcounting issues with users of rpc_pipefs</title>
<updated>2006-08-24T19:50:51+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-08-14T17:11:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8f8e7a50f450fcb86a5b2ffb94543c57a14f8260'/>
<id>8f8e7a50f450fcb86a5b2ffb94543c57a14f8260</id>
<content type='text'>
rpc_unlink() and rpc_rmdir() will dput the dentry reference for you.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from a05a57effa71a1f67ccbfc52335c10c8b85f3f6a commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rpc_unlink() and rpc_rmdir() will dput the dentry reference for you.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from a05a57effa71a1f67ccbfc52335c10c8b85f3f6a commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>SUNRPC: rpc_unlink() must check for unhashed dentries</title>
<updated>2006-08-24T19:50:42+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-08-10T21:51:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68adb0af51ebccb72ffb14d49cb8121b1afc4259'/>
<id>68adb0af51ebccb72ffb14d49cb8121b1afc4259</id>
<content type='text'>
A prior call to rpc_depopulate() by rpc_rmdir() on the parent directory may
have already called simple_unlink() on this entry.
Add the same check to rpc_rmdir(). Also remove a redundant call to
rpc_close_pipes() in rpc_rmdir.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 0bbfb9d20f6437c4031aa3bf9b4d311a053e58e3 commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A prior call to rpc_depopulate() by rpc_rmdir() on the parent directory may
have already called simple_unlink() on this entry.
Add the same check to rpc_rmdir(). Also remove a redundant call to
rpc_close_pipes() in rpc_rmdir.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 0bbfb9d20f6437c4031aa3bf9b4d311a053e58e3 commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>NFS: clean up rpc_rmdir</title>
<updated>2006-08-24T19:50:32+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-07-31T21:17:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dff02cc1a34fcb60904a2c57cb351857cc11219e'/>
<id>dff02cc1a34fcb60904a2c57cb351857cc11219e</id>
<content type='text'>
Make it take a dentry argument instead of a path

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 648d4116eb2509f010f7f34704a650150309b3e7 commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make it take a dentry argument instead of a path

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 648d4116eb2509f010f7f34704a650150309b3e7 commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>SUNRPC: make rpc_unlink() take a dentry argument instead of a path</title>
<updated>2006-08-24T19:50:07+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-07-31T21:11:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5d67476fff2df6ff12f60b540fd0e74cf2a668f9'/>
<id>5d67476fff2df6ff12f60b540fd0e74cf2a668f9</id>
<content type='text'>
Signe-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 88bf6d811b01a4be7fd507d18bf5f1c527989089 commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signe-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 88bf6d811b01a4be7fd507d18bf5f1c527989089 commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] knfsd: fix race related problem when adding items to and svcrpc auth cache</title>
<updated>2006-08-06T15:57:47+00:00</updated>
<author>
<name>Neil Brown</name>
<email>neilb@suse.de</email>
</author>
<published>2006-08-05T19:14:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2f34931fdc78b4895553aaa33748939cc7697c99'/>
<id>2f34931fdc78b4895553aaa33748939cc7697c99</id>
<content type='text'>
If we don't find the item we are lookng for, we allocate a new one, and
then grab the lock again and search to see if it has been added while we
did the alloc.  If it had been added we need to 'cache_put' the newly
created item that we are never going to use.  But as it hasn't been
initialised properly, putting it can cause an oops.

So move the -&gt;init call earlier to that it will always be fully initilised
if we have to put it.

Thanks to Philipp Matthias Hahn &lt;pmhahn@svs.Informatik.Uni-Oldenburg.de&gt;
for reporting the problem.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we don't find the item we are lookng for, we allocate a new one, and
then grab the lock again and search to see if it has been added while we
did the alloc.  If it had been added we need to 'cache_put' the newly
created item that we are never going to use.  But as it hasn't been
initialised properly, putting it can cause an oops.

So move the -&gt;init call earlier to that it will always be fully initilised
if we have to put it.

Thanks to Philipp Matthias Hahn &lt;pmhahn@svs.Informatik.Uni-Oldenburg.de&gt;
for reporting the problem.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>SUNRPC: Fix obvious refcounting bugs in rpc_pipefs.</title>
<updated>2006-08-03T20:57:26+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-07-29T21:37:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5c3e985a2c1908aa97221d3806f85ce7e2fbfa88'/>
<id>5c3e985a2c1908aa97221d3806f85ce7e2fbfa88</id>
<content type='text'>
Doh!

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 496f408f2f0e7ee5481a7c2222189be6c4f5aa6c commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Doh!

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 496f408f2f0e7ee5481a7c2222189be6c4f5aa6c commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>RPC: Ensure that we disconnect TCP socket when client requests error out</title>
<updated>2006-08-03T20:56:55+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-07-27T21:22:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e0ab53deaa91293a7958d63d5a2cf4c5645ad6f0'/>
<id>e0ab53deaa91293a7958d63d5a2cf4c5645ad6f0</id>
<content type='text'>
If we're part way through transmitting a TCP request, and the client
errors, then we need to disconnect and reconnect the TCP socket in order to
avoid confusing the server.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 031a50c8b9ea82616abd4a4e18021a25848941ce commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we're part way through transmitting a TCP request, and the client
errors, then we need to disconnect and reconnect the TCP socket in order to
avoid confusing the server.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 031a50c8b9ea82616abd4a4e18021a25848941ce commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>[NET]: Conversions from kmalloc+memset to k(z|c)alloc.</title>
<updated>2006-07-21T21:51:30+00:00</updated>
<author>
<name>Panagiotis Issaris</name>
<email>takis@issaris.org</email>
</author>
<published>2006-07-21T21:51:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0da974f4f303a6842516b764507e3c0a03f41e5a'/>
<id>0da974f4f303a6842516b764507e3c0a03f41e5a</id>
<content type='text'>
Signed-off-by: Panagiotis Issaris &lt;takis@issaris.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Panagiotis Issaris &lt;takis@issaris.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;

</pre>
</div>
</content>
</entry>
</feed>
