android_kernel_xiaomi_sm8450/fs/nfs
Li Lingfeng 7d0079d644 nfs: fix memory leak in error path of nfs4_do_reclaim
commit 8f6a7c9467eaf39da4c14e5474e46190ab3fb529 upstream.

Commit c77e22834a ("NFSv4: Fix a potential sleep while atomic in
nfs4_do_reclaim()") separate out the freeing of the state owners from
nfs4_purge_state_owners() and finish it outside the rcu lock.
However, the error path is omitted. As a result, the state owners in
"freeme" will not be released.
Fix it by adding freeing in the error path.

Fixes: c77e22834a ("NFSv4: Fix a potential sleep while atomic in nfs4_do_reclaim()")
Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
Cc: stable@vger.kernel.org # v5.3+
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-17 15:08:03 +02:00
..
blocklayout SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() 2024-06-21 14:52:33 +02:00
filelayout SUNRPC: Trace calls to .rpc_call_done 2024-06-21 14:53:24 +02:00
flexfilelayout SUNRPC: Trace calls to .rpc_call_done 2024-06-21 14:53:24 +02:00
cache_lib.c
cache_lib.h
callback_proc.c pNFS: Avoid a live lock condition in pnfs_update_layout() 2022-06-22 14:13:16 +02:00
callback_xdr.c SUNRPC: Parametrize how much of argsize should be zeroed 2024-06-21 14:54:00 +02:00
callback.c nfsd: stop setting ->pg_stats for unused stats 2024-09-12 11:06:45 +02:00
callback.h NFSv4.1: Fix uninitialised variable in devicenotify 2022-02-16 12:54:18 +01:00
client.c nfs: make the rpc_stat per net namespace 2024-05-17 11:47:59 +02:00
delegation.c NFS: Avoid unnecessary rescanning of the per-server delegation list 2024-10-17 15:07:32 +02:00
delegation.h NFSv4: Fix delegation return in cases where we have to retry 2021-07-20 16:05:47 +02:00
dir.c SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() 2024-06-21 14:52:33 +02:00
direct.c nfs: fix UAF in direct writes 2024-04-13 12:58:31 +02:00
dns_resolve.c NFS: remove duplicate headers 2020-05-27 10:10:12 -04:00
dns_resolve.h
export.c nfsd: allow reaping files still under writeback 2024-06-21 14:54:13 +02:00
file.c nfs: don't allow reexport reclaims 2024-06-21 14:53:19 +02:00
fs_context.c nfs: fix broken handling of the softreval mount option 2022-05-18 10:23:43 +02:00
fscache-index.c nfs: fscache: use timespec64 in inode auxdata 2020-01-15 10:54:30 -05:00
fscache.c NFSv4: Fix fscache cookie aux_data to ensure change_attr is included 2020-05-08 22:20:24 +01:00
fscache.h nfs: fscache: use timespec64 in inode auxdata 2020-01-15 10:54:30 -05:00
getroot.c NFS: Ensure security label is set for root inode 2020-03-30 19:56:50 -04:00
inode.c nfs: Handle error of rpc_proc_register() in nfs_net_init(). 2024-05-17 11:47:59 +02:00
internal.h nfs: fix undefined behavior in nfs_block_bits() 2024-06-16 13:32:36 +02:00
io.c
iostat.h
Kconfig nfs: fix PNFS_FLEXFILE_LAYOUT Kconfig default 2021-03-30 14:31:49 +02:00
Makefile NFSv4.2: add client side xattr caching. 2020-07-13 17:52:46 -04:00
mount_clnt.c NFSv3: fix rpc receive buffer size for MOUNT call 2020-05-14 18:42:44 -04:00
namespace.c NFS: Fix an Oops in nfs_d_automount() 2023-01-14 10:15:34 +01:00
netns.h nfs: make the rpc_stat per net namespace 2024-05-17 11:47:59 +02:00
nfs2super.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
nfs2xdr.c NFS: Guard against READDIR loop when entry names exceed MAXNAMELEN 2023-09-19 12:20:15 +02:00
nfs3_fs.h NFS: Additional refactoring for fs_context conversion 2020-01-15 10:15:17 -05:00
nfs3acl.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
nfs3client.c Revert "pNFS: nfs3_set_ds_client should set NFS_CS_NOPING" 2022-08-21 15:15:18 +02:00
nfs3proc.c nfs: fix acl memory leak of posix_acl_create() 2021-07-20 16:05:51 +02:00
nfs3super.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
nfs3xdr.c NFS: Guard against READDIR loop when entry names exceed MAXNAMELEN 2023-09-19 12:20:15 +02:00
nfs4_fs.h NFSv4: keep state manager thread active if swap is enabled 2023-03-11 16:39:38 +01:00
nfs4client.c nfs4: Fix kmemleak when allocate slot failed 2022-11-10 18:14:16 +01:00
nfs4file.c NFSv4.2: Remove ifdef CONFIG_NFSD from NFSv4.2 client SSC code. 2024-06-21 14:53:08 +02:00
nfs4getroot.c
nfs4idmap.c NFSv4: Fix races in the legacy idmapper upcall 2022-08-25 11:37:54 +02:00
nfs4idmap.h
nfs4namespace.c NFSv4 handle port presence in fs_location server string 2022-02-16 12:54:18 +01:00
nfs4proc.c NFS: Fix READ_PLUS when server doesn't support OP_READ_PLUS 2024-06-16 13:32:36 +02:00
nfs4renewd.c NFSv4.0: nfs4_do_fsinfo() should not do implicit lease renewals 2020-02-04 12:27:55 -05:00
nfs4session.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
nfs4session.h
nfs4state.c nfs: fix memory leak in error path of nfs4_do_reclaim 2024-10-17 15:08:03 +02:00
nfs4super.c NFS: Adjust fs_context error logging 2021-01-19 18:27:30 +01:00
nfs4sysctl.c
nfs4trace.c pNFS/flexfiles: Add tracing for layout errors 2020-01-15 10:54:33 -05:00
nfs4trace.h nfs4trace: fix state manager flag printing 2023-03-11 16:39:38 +01:00
nfs4xdr.c SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() 2024-06-21 14:52:33 +02:00
nfs42.h NFSv4.2: fix listxattr maximum XDR buffer size 2024-03-26 18:22:01 -04:00
nfs42proc.c NFSv4.2: fix handling of COPY ERR_OFFLOAD_NO_REQ 2023-09-19 12:20:16 +02:00
nfs42xattr.c NFSv4.2: fix failure to unregister shrinker 2020-11-12 10:40:02 -05:00
nfs42xdr.c SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() 2024-06-21 14:52:33 +02:00
nfs.h
nfsroot.c NFS: Fix an off by one in root_nfs_cat() 2024-03-26 18:22:01 -04:00
nfstrace.c
nfstrace.h nfs: define and use the NFS_INO_INVALID_XATTR flag 2020-07-13 17:52:45 -04:00
pagelist.c SUNRPC: Trace calls to .rpc_call_done 2024-06-21 14:53:24 +02:00
pnfs_dev.c NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info 2023-09-19 12:20:25 +02:00
pnfs_nfs.c NFS: nfsiod should not block forever in mempool_alloc() 2022-04-13 21:01:03 +02:00
pnfs.c NFS: avoid infinite loop in pnfs_update_layout. 2024-09-04 13:17:38 +02:00
pnfs.h pNFS: Avoid a live lock condition in pnfs_update_layout() 2022-06-22 14:13:16 +02:00
proc.c NFS: Add softreval behaviour to nfs_lookup_revalidate() 2020-01-24 16:51:13 -05:00
read.c nfs: Leave pages in the pagecache if readpage failed 2024-07-05 09:12:55 +02:00
super.c NFSv4: Add missing rescheduling points in nfs_client_return_marked_delegations 2024-09-12 11:06:49 +02:00
symlink.c nfs: pass the correct prototype to read_cache_page 2019-05-09 16:26:57 -04:00
sysctl.c
sysfs.c NFS: rename nfs_client_kset to nfs_kset 2023-10-10 21:53:36 +02:00
sysfs.h NFSv4: Fix up RCU annotations for struct nfs_netns_client 2020-10-15 13:31:08 -04:00
unlink.c NFS: Avoid referencing the cred twice in async rename/unlink 2020-03-16 08:34:29 -04:00
write.c SUNRPC: Trace calls to .rpc_call_done 2024-06-21 14:53:24 +02:00