mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
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: 67a56e9743 ("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
19c646f01e
commit
dbfc9e9878
@@ -678,8 +678,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;
|
||||
|
||||
Reference in New Issue
Block a user