stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFS: Remove superfluous kmap in nfs_readdir_xdr_to_array
@ 2020-03-13 20:24 Petr Malat
  2020-03-13 21:05 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Malat @ 2020-03-13 20:24 UTC (permalink / raw)
  To: stable, security; +Cc: Petr Malat

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>
---
 fs/nfs/dir.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index c2665d920cf8..2517fcd423b6 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -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;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-14  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-13 20:24 [PATCH] NFS: Remove superfluous kmap in nfs_readdir_xdr_to_array Petr Malat
2020-03-13 21:05 ` Linus Torvalds
2020-03-14  0:00   ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).