<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfsd, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-12-05T09:59:41Z</updated>
<entry>
<title>NFSD: Prevent a potential integer overflow</title>
<updated>2024-12-05T09:59:41Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2024-09-17T16:15:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=745f7ce5a95e783ba62fe774325829466aec2aa8'/>
<id>urn:sha1:745f7ce5a95e783ba62fe774325829466aec2aa8</id>
<content type='text'>
commit 7f33b92e5b18e904a481e6e208486da43e4dc841 upstream.

If the tag length is &gt;= U32_MAX - 3 then the "length + 4" addition
can result in an integer overflow. Address this by splitting the
decoding into several steps so that decode_cb_compound4res() does
not have to perform arithmetic on the unsafe length value.

Reported-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
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>NFSD: Cap the number of bytes copied by nfs4_reset_recoverydir()</title>
<updated>2024-12-05T09:59:36Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2024-10-17T15:03:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=60c8dd5dcd7520cbca3165bceec67cf7ee8443a6'/>
<id>urn:sha1:60c8dd5dcd7520cbca3165bceec67cf7ee8443a6</id>
<content type='text'>
[ Upstream commit f64ea4af43161bb86ffc77e6aeb5bcf5c3229df0 ]

It's only current caller already length-checks the string, but let's
be safe.

Fixes: 0964a3d3f1aa ("[PATCH] knfsd: nfsd4 reboot dirname fix")
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>NFSD: Prevent NULL dereference in nfsd4_process_cb_update()</title>
<updated>2024-12-05T09:59:36Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2024-10-17T15:03:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9a0d1f6e15859ea7a86a327f28491e23deaaa62'/>
<id>urn:sha1:d9a0d1f6e15859ea7a86a327f28491e23deaaa62</id>
<content type='text'>
[ Upstream commit 1e02c641c3a43c88cecc08402000418e15578d38 ]

@ses is initialized to NULL. If __nfsd4_find_backchannel() finds no
available backchannel session, setup_callback_client() will try to
dereference @ses and segfault.

Fixes: dcbeaa68dbbd ("nfsd4: allow backchannel recovery")
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>NFS: Remove print_overflow_msg()</title>
<updated>2024-11-08T15:19:17Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2019-02-11T16:24:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a818f644456feb3ca744f4f54b6d9ceaaed6135d'/>
<id>urn:sha1:a818f644456feb3ca744f4f54b6d9ceaaed6135d</id>
<content type='text'>
[ Upstream commit eb72f484a5eb94c53a241e6a7811270fb25200ad ]

This issue is now captured by a trace point in the RPC client.

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Stable-dep-of: 6dbf1f341b6b ("SUNRPC: Fix integer overflow in decode_rc_list()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfsd: fix delegation_blocked() to block correctly for at least 30 seconds</title>
<updated>2024-11-08T15:19:15Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2024-09-09T05:06:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ccbd18223985635b8dbb1393bacac9e1a5fa3f2f'/>
<id>urn:sha1:ccbd18223985635b8dbb1393bacac9e1a5fa3f2f</id>
<content type='text'>
[ Upstream commit 45bb63ed20e02ae146336412889fe5450316a84f ]

The pair of bloom filtered used by delegation_blocked() was intended to
block delegations on given filehandles for between 30 and 60 seconds.  A
new filehandle would be recorded in the "new" bit set.  That would then
be switch to the "old" bit set between 0 and 30 seconds later, and it
would remain as the "old" bit set for 30 seconds.

Unfortunately the code intended to clear the old bit set once it reached
30 seconds old, preparing it to be the next new bit set, instead cleared
the *new* bit set before switching it to be the old bit set.  This means
that the "old" bit set is always empty and delegations are blocked
between 0 and 30 seconds.

This patch updates bd-&gt;new before clearing the set with that index,
instead of afterwards.

Reported-by: Olga Kornievskaia &lt;okorniev@redhat.com&gt;
Cc: stable@vger.kernel.org
Fixes: 6282cd565553 ("NFSD: Don't hand out delegations for 30 seconds after recalling them.")
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Reviewed-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfsd: use ktime_get_seconds() for timestamps</title>
<updated>2024-11-08T15:19:15Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2017-10-20T09:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f81fcf39509d30cb5f1c659099c1d8f0c2a9a57a'/>
<id>urn:sha1:f81fcf39509d30cb5f1c659099c1d8f0c2a9a57a</id>
<content type='text'>
[ Upstream commit b3f255ef6bffc18a28c3b6295357f2a3380c033f ]

The delegation logic in nfsd uses the somewhat inefficient
seconds_since_boot() function to record time intervals.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Stable-dep-of: 45bb63ed20e0 ("nfsd: fix delegation_blocked() to block correctly for at least 30 seconds")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfsd: call cache_put if xdr_reserve_space returns NULL</title>
<updated>2024-11-08T15:19:07Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2024-08-21T14:03:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e8081ebff12bec1347deaceb6bce0765cce54df'/>
<id>urn:sha1:3e8081ebff12bec1347deaceb6bce0765cce54df</id>
<content type='text'>
[ Upstream commit d078cbf5c38de83bc31f83c47dcd2184c04a50c7 ]

If not enough buffer space available, but idmap_lookup has triggered
lookup_fn which calls cache_get and returns successfully. Then we
missed to call cache_put here which pairs with cache_get.

Fixes: ddd1ea563672 ("nfsd4: use xdr_reserve_space in attribute encoding")
Signed-off-by: Guoqing Jiang &lt;guoqing.jiang@linux.dev&gt;
Reviwed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfsd: drop st_mutex before calling move_to_close_lru()</title>
<updated>2024-06-16T11:23:25Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2024-04-08T02:09:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=52d3370e8022ce28cd8cf4d16c09245aa683d7fb'/>
<id>urn:sha1:52d3370e8022ce28cd8cf4d16c09245aa683d7fb</id>
<content type='text'>
[ Upstream commit 56c35f43eef013579c76c007ba1f386d8c2cac14 ]

move_to_close_lru() is currently called with -&gt;st_mutex held.
This can lead to a deadlock as move_to_close_lru() waits for sc_count to
drop to 2, and some threads holding a reference might be waiting for the
mutex.  These references will never be dropped so sc_count will never
reach 2.

There can be no harm in dropping -&gt;st_mutex before
move_to_close_lru() because the only place that takes the mutex is
nfsd4_lock_ol_stateid(), and it quickly aborts if sc_type is
NFS4_CLOSED_STID, which it will be before move_to_close_lru() is called.

See also
 https://lore.kernel.org/lkml/4dd1fe21e11344e5969bb112e954affb@jd.com/T/
where this problem was raised but not successfully resolved.

Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "NFSD: Fix possible sleep during nfsd4_release_lockowner()"</title>
<updated>2024-01-25T22:33:39Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2024-01-22T23:29:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=10d75984495f7fe62152c3b0dbfa3f0a6b739c9b'/>
<id>urn:sha1:10d75984495f7fe62152c3b0dbfa3f0a6b739c9b</id>
<content type='text'>
This reverts commit ef481b262bba4f454351eec43f024fec942c2d4c which is
commit ce3c4ad7f4ce5db7b4f08a1e237d8dd94b39180b upstream.

The maintainers ask it to be removed in this branch.

Cc: Dai Ngo &lt;dai.ngo@oracle.com&gt;
Cc: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Cc: Neil Brown &lt;neilb@suse.de&gt;
Cc: Jeff Layton &lt;jlayton@kernel.org&gt;
Link: https://lore.kernel.org/linux-nfs/3162C5BC-8E7C-4A9A-815C-09297B56FA17@oracle.com/T/#t
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>nfsd: lock_rename() needs both directories to live on the same fs</title>
<updated>2023-11-08T10:22:18Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2023-10-15T01:34:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61f5f6c1a896c3c0b7e3cc1d7cc5a8b8cac45708'/>
<id>urn:sha1:61f5f6c1a896c3c0b7e3cc1d7cc5a8b8cac45708</id>
<content type='text'>
commit 1aee9158bc978f91701c5992e395efbc6da2de3c upstream.

... checking that after lock_rename() is too late.  Incidentally,
NFSv2 had no nfserr_xdev...

Fixes: aa387d6ce153 "nfsd: fix EXDEV checking in rename"
Cc: stable@vger.kernel.org # v3.9+
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Acked-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Tested-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
