Commit 4a4a4aff authored by Petr Malat's avatar Petr Malat Committed by Kelsey Skunberg

NFS: Remove superfluous kmap in nfs_readdir_xdr_to_array

BugLink: https://bugs.launchpad.net/bugs/1868629

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: 67a56e97 ("NFS: Fix memory leaks and corruption in readdir")
Signed-off-by: default avatarPetr Malat <oss@malat.biz>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent cfdfb28c
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment