This is a note to let you know that I've just added the patch titled NFSv4.2: fix failure to unregister shrinker to the 5.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: nfsv4.2-fix-failure-to-unregister-shrinker.patch and it can be found in the queue-5.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 70438afbf17e5194dd607dd17759560a363b7bb4 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" <bfields@xxxxxxxxxx> Date: Wed, 21 Oct 2020 10:34:15 -0400 Subject: NFSv4.2: fix failure to unregister shrinker From: J. Bruce Fields <bfields@xxxxxxxxxx> commit 70438afbf17e5194dd607dd17759560a363b7bb4 upstream. We forgot to unregister the nfs4_xattr_large_entry_shrinker. That leaves the global list of shrinkers corrupted after unload of the nfs module, after which possibly unrelated code that calls register_shrinker() or unregister_shrinker() gets a BUG() with "supervisor write access in kernel mode". And similarly for the nfs4_xattr_large_entry_lru. Reported-by: Kris Karas <bugs-a17@xxxxxxxxxxxxxxxx> Tested-By: Kris Karas <bugs-a17@xxxxxxxxxxxxxxxx> Fixes: 95ad37f90c33 "NFSv4.2: add client side xattr caching." Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxx> CC: stable@xxxxxxxxxxxxxxx Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/nfs/nfs42xattr.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/nfs/nfs42xattr.c +++ b/fs/nfs/nfs42xattr.c @@ -1048,8 +1048,10 @@ out4: void nfs4_xattr_cache_exit(void) { + unregister_shrinker(&nfs4_xattr_large_entry_shrinker); unregister_shrinker(&nfs4_xattr_entry_shrinker); unregister_shrinker(&nfs4_xattr_cache_shrinker); + list_lru_destroy(&nfs4_xattr_large_entry_lru); list_lru_destroy(&nfs4_xattr_entry_lru); list_lru_destroy(&nfs4_xattr_cache_lru); kmem_cache_destroy(nfs4_xattr_cache_cachep); Patches currently in stable-queue which might be from bfields@xxxxxxxxxx are queue-5.9/nfsv4.2-fix-failure-to-unregister-shrinker.patch queue-5.9/nfsd-fix-use-after-free-warning-when-doing-inter-ser.patch queue-5.9/sunrpc-fix-general-protection-fault-in-trace_rpc_xdr.patch queue-5.9/nfsd-fix-missing-refcount-in-nfsd4_copy-by-nfsd4_do_.patch