diff options
author | Petr Malat <oss@malat.biz> | 2020-03-13 21:24:43 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-20 09:06:18 +0100 |
commit | dc369d74c17ed41154ee7419cb94512c4757e9f6 (patch) | |
tree | d85c820827d5d6cf1cdc4fcdb638e881613d4390 /fs | |
parent | 6fd21f1d7907d9cfcd406bc64935aa00fa100b66 (diff) |
NFS: Remove superfluous kmap in nfs_readdir_xdr_to_array
Array is mapped by nfs_readdir_get_array(), the further kmap is a result
of a bad merge and should be removed.
This resource leakage can be exploited for DoS by receptively reading
a content of a directory on NFS (e.g. by running ls).
Fixes: 67a56e9743171 ("NFS: Fix memory leaks and corruption in readdir")
Signed-off-by: Petr Malat <oss@malat.biz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/dir.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 2ac3d2527ad2..21e5fcbcb227 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -657,8 +657,6 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, goto out_label_free; } - array = kmap(page); - status = nfs_readdir_alloc_pages(pages, array_size); if (status < 0) goto out_release_array; |