linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bugfix nfs kmap_atomic (fwd)
@ 2003-04-11 18:59 Rik van Riel
  0 siblings, 0 replies; only message in thread
From: Rik van Riel @ 2003-04-11 18:59 UTC (permalink / raw)
  To: linux-kernel

Oops, wrong address at first ;)

---------- Forwarded message ----------
Date: Fri, 11 Apr 2003 14:44:28 -0400 (EDT)
From: Rik van Riel <riel@surriel.com>
Subject: [PATCH] bugfix nfs kmap_atomic


There's a serious bug in the handling of the pointer returned
by kmap_atomic() in nfs/dir.c.   The pointer (part of desc) is
passed into find_dirent_name and from there into dir_decode,
which modifies the pointer.

That means you end up passing a wrong address to kunmap_atomic().
The patch below fixes it by remembering the address that kmap_atomic()
told us.

Please apply. Thank you,

Rik

===== fs/nfs/dir.c 1.53 vs edited =====
--- 1.53/fs/nfs/dir.c	Mon Apr  7 18:22:57 2003
+++ edited/fs/nfs/dir.c	Fri Apr 11 14:40:39 2003
@@ -714,6 +714,7 @@
 	struct nfs_server *server;
 	struct nfs_entry entry;
 	struct page *page;
+	void * kaddr;
 	unsigned long timestamp = NFS_MTIME_UPDATE(dir);
 	int res;
 
@@ -736,9 +737,9 @@
 
 		res = -EIO;
 		if (PageUptodate(page)) {
-			desc.ptr = kmap_atomic(page, KM_USER0);
+			kaddr = desc.ptr = kmap_atomic(page, KM_USER0);
 			res = find_dirent_name(&desc, page, dentry);
-			kunmap_atomic(desc.ptr, KM_USER0);
+			kunmap_atomic(kaddr, KM_USER0);
 		}
 		page_cache_release(page);
 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-11 18:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-11 18:59 [PATCH] bugfix nfs kmap_atomic (fwd) Rik van Riel

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).