Skip to contentSkip to conversation

NFS: fix highmem leak exist in nfs_readdir_xdr_to_array

PATCH In review yangerkun 2 participants 3 messages Mar 10, 2020 Stable branch

lore
Share & tools
lore

yangerkun

author
#0 lore raw

PATCH 1/1 NFS: fix highmem leak exist in nfs_readdir_xdr_to_array

The patch 'e22dea67d2f7 ("NFS: Fix memory leaks and corruption in readdir")' in 4.4.y/4.9.y will introduce a highmem leak. Actually, nfs_readdir_get_array has did what we want to do. No need to call kmap again.

---
 fs/nfs/dir.c | 2 --
 1 file changed, 2 deletions(-)
fs/nfs/dir.c +0 -2
index c2665d920cf8..2517fcd423b6 100644
@@ -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;
Signature · 1 line
2.17.2
maintainer
#1 lore raw
Quoted 26 lines · yangerkun

The patch 'e22dea67d2f7 ("NFS: Fix memory leaks and corruption in readdir")' in 4.4.y/4.9.y will introduce a highmem leak. Actually, nfs_readdir_get_array has did what we want to do. No need to call kmap again.

---
 fs/nfs/dir.c | 2 --
 1 file changed, 2 deletions(-)
fs/nfs/dir.c +0 -2
index c2665d920cf8..2517fcd423b6 100644
@@ -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;
Signature · 1 line
2.17.2

Can you resend and cc: the NFS developers and maintainers on this change? I need their ack to be able to apply it.

thanks,

greg k-h

author
#2 lore raw
Quoted 19 lines · Greg KH
Quoted 18 lines · yangerkun

The patch 'e22dea67d2f7 ("NFS: Fix memory leaks and corruption in readdir")' in 4.4.y/4.9.y will introduce a highmem leak. Actually, nfs_readdir_get_array has did what we want to do. No need to call kmap again.

---
  fs/nfs/dir.c | 2 --
  1 file changed, 2 deletions(-)
fs/nfs/dir.c +0 -0
index c2665d920cf8..2517fcd423b6 100644
@@ -678,8 +678,6 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page,
  		goto out_label_free;
  	}
 
Quoted 11 lines
Quoted 8 lines
fs/nfs/dir.c +0 -2
-	array = kmap(page);
-
  	status = nfs_readdir_alloc_pages(pages, array_size);
  	if (status < 0)
  		goto out_release_array;
Signature · 1 line
2.17.2

Can you resend and cc: the NFS developers and maintainers on this change? I need their ack to be able to apply it.

Okay, will do it right now.

Thanks,
Kun.

Quoted 8 lines

thanks,

greg k-h

.