<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sunrpc/xdr.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-11-27T15:05:37Z</updated>
<entry>
<title>SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer()</title>
<updated>2018-11-27T15:05:37Z</updated>
<author>
<name>YueHaibing</name>
</author>
<published>2018-11-08T02:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eace490809a40e246349542f92610e0953c0237b'/>
<id>urn:sha1:eace490809a40e246349542f92610e0953c0237b</id>
<content type='text'>
[ Upstream commit 025911a5f4e36955498ed50806ad1b02f0f76288 ]

There is no need to have the '__be32 *p' variable static since new value
always be assigned before use it.

Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sunrpc: correct the computation for page_ptr when truncating</title>
<updated>2018-11-22T06:32:48Z</updated>
<author>
<name>Frank Sorenson</name>
</author>
<published>2018-10-30T20:10:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7b86a9a6c9fe6ae8c810121a2396dc3a652c8b67'/>
<id>urn:sha1:7b86a9a6c9fe6ae8c810121a2396dc3a652c8b67</id>
<content type='text'>
commit 5d7a5bcb67c70cbc904057ef52d3fcfeb24420bb upstream.

When truncating the encode buffer, the page_ptr is getting
advanced, causing the next page to be skipped while encoding.
The page is still included in the response, so the response
contains a page of bogus data.

We need to adjust the page_ptr backwards to ensure we encode
the next page into the correct place.

We saw this triggered when concurrent directory modifications caused
nfsd4_encode_direct_fattr() to return nfserr_noent, and the resulting
call to xdr_truncate_encode() corrupted the READDIR reply.

Signed-off-by: Frank Sorenson &lt;sorenson@redhat.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rpc: fix xdr_truncate_encode to handle buffer ending on page boundary</title>
<updated>2015-01-16T14:59:55Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2014-12-22T21:14:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9e80aeb7c7244c29b2c28049cd2149d3ab10a56a'/>
<id>urn:sha1:9e80aeb7c7244c29b2c28049cd2149d3ab10a56a</id>
<content type='text'>
commit 49a068f82a1d30eb585d7804b05948376be6cf9a upstream.

A struct xdr_stream at a page boundary might point to the end of one
page or the beginning of the next, but xdr_truncate_encode isn't
prepared to handle the former.

This can cause corruption of NFSv4 READDIR replies in the case that a
readdir entry that would have exceeded the client's dircount/maxcount
limit would have ended exactly on a 4k page boundary.  You're more
likely to hit this case on large directories.

Other xdr_truncate_encode callers are probably also affected.

Reported-by: Holger Hoffstätte &lt;holger.hoffstaette@googlemail.com&gt;
Tested-by: Holger Hoffstätte &lt;holger.hoffstaette@googlemail.com&gt;
Fixes: 3e19ce762b53 "rpc: xdr_truncate_encode"
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>SUNRPC: xdr_get_next_encode_buffer should be declared static</title>
<updated>2014-07-18T15:35:46Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2014-07-12T22:01:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22cb43855dce2cb1b23c5b8c5c83e9baa4cfde6e'/>
<id>urn:sha1:22cb43855dce2cb1b23c5b8c5c83e9baa4cfde6e</id>
<content type='text'>
Quell another sparse warning.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>nfsd4: simplify server xdr-&gt;next_page use</title>
<updated>2014-06-06T23:22:46Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2014-06-02T16:05:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05638dc73af2586517468b1159d4b76e90607359'/>
<id>urn:sha1:05638dc73af2586517468b1159d4b76e90607359</id>
<content type='text'>
The rpc code makes available to the NFS server an array of pages to
encod into.  The server represents its reply as an xdr buf, with the
head pointing into the first page in that array, the pages ** array
starting just after that, and the tail (if any) sharing any leftover
space in the page used by the head.

While encoding, we use xdr_stream-&gt;page_ptr to keep track of which page
we're currently using.

Currently we set xdr_stream-&gt;page_ptr to buf-&gt;pages, which makes the
head a weird exception to the rule that page_ptr always points to the
page we're currently encoding into.  So, instead set it to buf-&gt;pages -
1 (the page actually containing the head), and remove the need for a
little unintuitive logic in xdr_get_next_encode_buffer() and
xdr_truncate_encode.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>rpc: define xdr_restrict_buflen</title>
<updated>2014-05-30T21:32:01Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2014-03-06T18:22:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=db3f58a95beea6752d90fed03f9f198d282a3913'/>
<id>urn:sha1:db3f58a95beea6752d90fed03f9f198d282a3913</id>
<content type='text'>
With this xdr_reserve_space can help us enforce various limits.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>nfsd4: allow encoding across page boundaries</title>
<updated>2014-05-30T21:31:54Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2013-08-26T20:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2825a7f90753012babe7ee292f4a1eadd3706f92'/>
<id>urn:sha1:2825a7f90753012babe7ee292f4a1eadd3706f92</id>
<content type='text'>
After this we can handle for example getattr of very large ACLs.

Read, readdir, readlink are still special cases with their own limits.

Also we can't handle a new operation starting close to the end of a
page.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>rpc: xdr_truncate_encode</title>
<updated>2014-05-30T21:31:47Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2014-02-25T22:44:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e19ce762b537dd9aeefdd0849ba5f2f01ff83cf'/>
<id>urn:sha1:3e19ce762b537dd9aeefdd0849ba5f2f01ff83cf</id>
<content type='text'>
This will be used in the server side in a few cases:
	- when certain operations (read, readdir, readlink) fail after
	  encoding a partial response.
	- when we run out of space after encoding a partial response.
	- in readlink, where we initially reserve PAGE_SIZE bytes for
	  data, then truncate to the actual size.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>rpc: Allow xdr_buf_subsegment to operate in-place</title>
<updated>2014-03-29T01:24:49Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2014-02-25T22:21:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de4aee2e0a376fb272f44139150115a6dec1da95'/>
<id>urn:sha1:de4aee2e0a376fb272f44139150115a6dec1da95</id>
<content type='text'>
Allow

	xdr_buf_subsegment(&amp;buf, &amp;buf, base, len)

to modify an xdr_buf in-place.

Also, none of the callers need the iov_base of head or tail to be zeroed
out.

Also add documentation.

(As it turns out, I'm not really using this new guarantee, but it seems
a simple way to make this function a bit more robust.)

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Fix memory corruption issue on 32-bit highmem systems</title>
<updated>2013-08-28T19:43:43Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2013-08-28T17:35:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=347e2233b7667e336d9f671f1a52dfa3f0416e2c'/>
<id>urn:sha1:347e2233b7667e336d9f671f1a52dfa3f0416e2c</id>
<content type='text'>
Some architectures, such as ARM-32 do not return the same base address
when you call kmap_atomic() twice on the same page.
This causes problems for the memmove() call in the XDR helper routine
"_shift_data_right_pages()", since it defeats the detection of
overlapping memory ranges, and has been seen to corrupt memory.

The fix is to distinguish between the case where we're doing an
inter-page copy or not. In the former case of we know that the memory
ranges cannot possibly overlap, so we can additionally micro-optimise
by replacing memmove() with memcpy().

Reported-by: Mark Young &lt;MYoung@nvidia.com&gt;
Reported-by: Matt Craighead &lt;mcraighead@nvidia.com&gt;
Cc: Bruce Fields &lt;bfields@fieldses.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Tested-by: Matt Craighead &lt;mcraighead@nvidia.com&gt;
</content>
</entry>
</feed>
