<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sunrpc/xdr.c, branch linux-5.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-07-07T15:54:47Z</updated>
<entry>
<title>SUNRPC: Fix READ_PLUS crasher</title>
<updated>2022-07-07T15:54:47Z</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=3d858d8717d8c6f59c75f603900b8089c3e0c3a4'/>
<id>urn:sha1:3d858d8717d8c6f59c75f603900b8089c3e0c3a4</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-14T16:45:06Z</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=c22fa18fb51500a44f226984e95f6bbee5def4d2'/>
<id>urn:sha1:c22fa18fb51500a44f226984e95f6bbee5def4d2</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: xdr_stream_subsegment() must handle non-zero page_bases</title>
<updated>2021-10-02T20:10:01Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2021-09-30T21:06:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f49b68ddc9d7dddf1530312108a648dd815a2f30'/>
<id>urn:sha1:f49b68ddc9d7dddf1530312108a648dd815a2f30</id>
<content type='text'>
xdr_stream_subsegment() was introduced in commit c1346a1216ab
("NFSD: Replace the internals of the READ_BUF() macro").

There are two call sites for xdr_stream_subsegment(). One is
nfsd4_decode_write(), and the other is nfsd4_decode_setxattr().
Currently neither of these call sites calls this API when
xdr_buf::page_base is a non-zero value.

However, I'm about to add a case where page_base will sometimes not
be zero when nfsd4_decode_write() invokes this API. Replace the
logic in xdr_stream_subsegment() that advances to the next data item
in the xdr_stream with something more generic in order to handle
this new use case.

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
</entry>
<entry>
<title>sunrpc: Avoid a KASAN slab-out-of-bounds bug in xdr_set_page_base()</title>
<updated>2021-06-13T23:36:49Z</updated>
<author>
<name>Anna Schumaker</name>
</author>
<published>2021-06-09T21:07:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d1c0f3d28f98ea2736128ed3e46821496dc3a8c'/>
<id>urn:sha1:6d1c0f3d28f98ea2736128ed3e46821496dc3a8c</id>
<content type='text'>
This seems to happen fairly easily during READ_PLUS testing on NFS v4.2.
I found that we could end up accessing xdr-&gt;buf-&gt;pages[pgnr] with a pgnr
greater than the number of pages in the array. So let's just return
early if we're setting base to a point at the end of the page data and
let xdr_set_tail_base() handle setting up the buffer pointers instead.

Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Fixes: 8d86e373b0ef ("SUNRPC: Clean up helpers xdr_set_iov() and xdr_set_page_base()")
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'nfs-for-5.11-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs</title>
<updated>2020-12-17T20:15:03Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2020-12-17T20:15:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74f602dc96dd854c7b2034947798c1e2a6b84066'/>
<id>urn:sha1:74f602dc96dd854c7b2034947798c1e2a6b84066</id>
<content type='text'>
Pull NFS client updates from Trond Myklebust:
 "Highlights include:

  Features:

   - NFSv3: Add emulation of lookupp() to improve open_by_filehandle()
     support

   - A series of patches to improve readdir performance, particularly
     with large directories

   - Basic support for using NFS/RDMA with the pNFS files and flexfiles
     drivers

   - Micro-optimisations for RDMA

   - RDMA tracing improvements

  Bugfixes:

   - Fix a long standing bug with xs_read_xdr_buf() when receiving
     partial pages (Dan Aloni)

   - Various fixes for getxattr and listxattr, when used over non-TCP
     transports

   - Fixes for containerised NFS from Sargun Dhillon

   - switch nfsiod to be an UNBOUND workqueue (Neil Brown)

   - READDIR should not ask for security label information if there is
     no LSM policy (Olga Kornievskaia)

   - Avoid using interval-based rebinding with TCP in lockd (Calum
     Mackay)

   - A series of RPC and NFS layer fixes to support the NFSv4.2
     READ_PLUS code

   - A couple of fixes for pnfs/flexfiles read failover

  Cleanups:

   - Various cleanups for the SUNRPC xdr code in conjunction with the
     READ_PLUS fixes"

* tag 'nfs-for-5.11-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (90 commits)
  NFS/pNFS: Fix a typo in ff_layout_resend_pnfs_read()
  pNFS/flexfiles: Avoid spurious layout returns in ff_layout_choose_ds_for_read
  NFSv4/pnfs: Add tracing for the deviceid cache
  fs/lockd: convert comma to semicolon
  NFSv4.2: fix error return on memory allocation failure
  NFSv4.2/pnfs: Don't use READ_PLUS with pNFS yet
  NFSv4.2: Deal with potential READ_PLUS data extent buffer overflow
  NFSv4.2: Don't error when exiting early on a READ_PLUS buffer overflow
  NFSv4.2: Handle hole lengths that exceed the READ_PLUS read buffer
  NFSv4.2: decode_read_plus_hole() needs to check the extent offset
  NFSv4.2: decode_read_plus_data() must skip padding after data segment
  NFSv4.2: Ensure we always reset the result-&gt;count in decode_read_plus()
  SUNRPC: When expanding the buffer, we may need grow the sparse pages
  SUNRPC: Cleanup - constify a number of xdr_buf helpers
  SUNRPC: Clean up open coded setting of the xdr_stream 'nwords' field
  SUNRPC: _copy_to/from_pages() now check for zero length
  SUNRPC: Cleanup xdr_shrink_bufhead()
  SUNRPC: Fix xdr_expand_hole()
  SUNRPC: Fixes for xdr_align_data()
  SUNRPC: _shift_data_left/right_pages should check the shift length
  ...
</content>
</entry>
<entry>
<title>SUNRPC: When expanding the buffer, we may need grow the sparse pages</title>
<updated>2020-12-14T11:51:07Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-12-10T13:55:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5802f7c2a6b876b2810e3e9f26d719961f12e251'/>
<id>urn:sha1:5802f7c2a6b876b2810e3e9f26d719961f12e251</id>
<content type='text'>
If we're shifting the page data to the right, and this happens to be a
sparse page array, then we may need to allocate new pages in order to
receive the data.

Reported-by: "Mkrtchyan, Tigran" &lt;tigran.mkrtchyan@desy.de&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Cleanup - constify a number of xdr_buf helpers</title>
<updated>2020-12-14T11:51:07Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-12-09T03:56:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8d0e60f1056687826abc1eded98f0ea067dfc4c'/>
<id>urn:sha1:f8d0e60f1056687826abc1eded98f0ea067dfc4c</id>
<content type='text'>
There are a number of xdr helpers for struct xdr_buf that do not change
the structure itself. Mark those as taking const pointers for
documentation purposes.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Clean up open coded setting of the xdr_stream 'nwords' field</title>
<updated>2020-12-14T11:51:07Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-12-08T20:02:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a5f1c2c2cbb6ddef637abb7c7e7cab20b9cc933'/>
<id>urn:sha1:5a5f1c2c2cbb6ddef637abb7c7e7cab20b9cc933</id>
<content type='text'>
Move the setting of the xdr_stream 'nwords' field into the helpers that
reset the xdr_stream cursor.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: _copy_to/from_pages() now check for zero length</title>
<updated>2020-12-14T11:51:07Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-12-06T17:41:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e43ac22b83921928479da0bad25aaee3d95c2b1a'/>
<id>urn:sha1:e43ac22b83921928479da0bad25aaee3d95c2b1a</id>
<content type='text'>
Clean up callers of _copy_to/from_pages() that still check for a zero
length.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Cleanup xdr_shrink_bufhead()</title>
<updated>2020-12-14T11:51:07Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2020-12-06T15:15:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6707fbd7d3be72da4ebde7f56b46814befd2db19'/>
<id>urn:sha1:6707fbd7d3be72da4ebde7f56b46814befd2db19</id>
<content type='text'>
Clean up xdr_shrink_bufhead() to use the new helpers instead of doing
its own thing.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
</feed>
