<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sunrpc/xdr.c, branch linux-4.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-07-07T15:31:16Z</updated>
<entry>
<title>SUNRPC: Fix READ_PLUS crasher</title>
<updated>2022-07-07T15:31:16Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2022-06-30T20:48:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b549fcd00780f49b2150bc835371f31c03936678'/>
<id>urn:sha1:b549fcd00780f49b2150bc835371f31c03936678</id>
<content type='text'>
commit a23dd544debcda4ee4a549ec7de59e85c3c8345c upstream.

Looks like there are still cases when "space_left - frag1bytes" can
legitimately exceed PAGE_SIZE. Ensure that xdr-&gt;end always remains
within the current encode buffer.

Reported-by: Bruce Fields &lt;bfields@fieldses.org&gt;
Reported-by: Zorro Lang &lt;zlang@redhat.com&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216151
Fixes: 6c254bf3b637 ("SUNRPC: Fix the calculation of xdr-&gt;end in xdr_get_next_encode_buffer()")
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Fix the calculation of xdr-&gt;end in xdr_get_next_encode_buffer()</title>
<updated>2022-06-14T14:53:58Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2022-06-07T20:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0c01793097e4f8a86e2187bf7302161b21c3081'/>
<id>urn:sha1:d0c01793097e4f8a86e2187bf7302161b21c3081</id>
<content type='text'>
[ Upstream commit 6c254bf3b637dd4ef4f78eb78c7447419c0161d7 ]

I found that NFSD's new NFSv3 READDIRPLUS XDR encoder was screwing up
right at the end of the page array. xdr_get_next_encode_buffer() does
not compute the value of xdr-&gt;end correctly:

 * The check to see if we're on the final available page in xdr-&gt;buf
   needs to account for the space consumed by @nbytes.

 * The new xdr-&gt;end value needs to account for the portion of @nbytes
   that is to be encoded into the previous buffer.

Fixes: 2825a7f90753 ("nfsd4: allow encoding across page boundaries")
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Reviewed-by: NeilBrown &lt;neilb@suse.de&gt;
Reviewed-by: J. Bruce Fields &lt;bfields@fieldses.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment()</title>
<updated>2020-06-30T19:38:09Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2020-06-25T15:32:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=653db17384a3a1875d13cab23e7a4bd04188e9e0'/>
<id>urn:sha1:653db17384a3a1875d13cab23e7a4bd04188e9e0</id>
<content type='text'>
commit 89a3c9f5b9f0bcaa9aea3e8b2a616fcaea9aad78 upstream.

@subbuf is an output parameter of xdr_buf_subsegment(). A survey of
call sites shows that @subbuf is always uninitialized before
xdr_buf_segment() is invoked by callers.

There are some execution paths through xdr_buf_subsegment() that do
not set all of the fields in @subbuf, leaving some pointer fields
containing garbage addresses. Subsequent processing of that buffer
then results in a page fault.

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer()</title>
<updated>2018-11-27T15:10:49Z</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=26eff850549b52e43d0bc61f4682952fe2da293d'/>
<id>urn:sha1:26eff850549b52e43d0bc61f4682952fe2da293d</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-21T08:24:14Z</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=a56609f725c3cfff71e0878036263477d59755a4'/>
<id>urn:sha1:a56609f725c3cfff71e0878036263477d59755a4</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>sunrpc: Fix xdr_init_decode_pages() documenting comment</title>
<updated>2017-04-25T20:12:34Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2017-04-11T17:23:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7ecce75fc3c52590950bc5e68eac0f00e50e8ce4'/>
<id>urn:sha1:7ecce75fc3c52590950bc5e68eac0f00e50e8ce4</id>
<content type='text'>
Clean up.

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Add a helper function xdr_stream_decode_string_dup()</title>
<updated>2017-02-21T21:56:16Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2017-02-19T21:08:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c741d4f2215371ae17e3dbdf3d46da850662e13'/>
<id>urn:sha1:5c741d4f2215371ae17e3dbdf3d46da850662e13</id>
<content type='text'>
Create a helper function that decodes a xdr string object, allocates a memory
buffer and then store it as a NUL terminated string.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Reviewed-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Fix setting of buffer length in xdr_set_next_buffer()</title>
<updated>2016-09-22T21:17:47Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2016-09-20T18:33:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6cebd41b83a271d5b1dcaa5b4676df899f8d4ea'/>
<id>urn:sha1:a6cebd41b83a271d5b1dcaa5b4676df899f8d4ea</id>
<content type='text'>
Use xdr-&gt;nwords to tell us how much buffer remains.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Fix corruption of xdr-&gt;nwords in xdr_copy_to_scratch</title>
<updated>2016-09-22T21:12:31Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2016-09-20T18:33:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ace0e14f4fe5f5944d27d8bd4d3492ad0d2b09e2'/>
<id>urn:sha1:ace0e14f4fe5f5944d27d8bd4d3492ad0d2b09e2</id>
<content type='text'>
When we copy the first part of the data, we need to ensure that value
of xdr-&gt;nwords is updated as well. Do so by calling __xdr_inline_decode()

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: init xdr_stream for zero iov_len, page_len</title>
<updated>2016-05-09T13:05:40Z</updated>
<author>
<name>Benjamin Coddington</name>
</author>
<published>2016-04-06T15:32:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06ef26a0e35199cc0445d7d5708533a12af8ff5b'/>
<id>urn:sha1:06ef26a0e35199cc0445d7d5708533a12af8ff5b</id>
<content type='text'>
An xdr_buf with head[0].iov_len = 0 and page_len = 0 will cause
xdr_init_decode() to incorrectly setup the xdr_stream.  Specifically,
xdr-&gt;end is never initialized.

Signed-off-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
</content>
</entry>
</feed>
