diff options
| author | Trond Myklebust <trondmy@gmail.com> | 2020-02-02 17:53:53 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-14 16:29:59 -0500 |
| commit | 0b0223f9c3a82bec63a41f2b85029ef2bdae76d4 (patch) | |
| tree | 997cea9558b14ca66e948bb706892aa21ae27931 /fs/nfs/nfs4client.c | |
| parent | a5fb06a8a2334b68085cde119637a680050a6687 (diff) | |
NFS: Fix memory leaks and corruption in readdir
[ Upstream commit 4b310319c6a8ce708f1033d57145e2aa027a883c ]
nfs_readdir_xdr_to_array() must not exit without having initialised
the array, so that the page cache deletion routines can safely
call nfs_readdir_clear_array().
Furthermore, we should ensure that if we exit nfs_readdir_filler()
with an error, we free up any page contents to prevent a leak
if we try to fill the page again.
Fixes: 11de3b11e08c ("NFS: Fix a memory leak in nfs_readdir")
Cc: stable@vger.kernel.org # v2.6.37+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nfs/nfs4client.c')
0 files changed, 0 insertions, 0 deletions
