Commit 8f44c5c2 authored by Linus Torvalds's avatar Linus Torvalds

Make sure to kunmap() the right address in fs/nfs/dir.c.

Found by Rik van Riel:

 "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()."
parent d26a42bb
......@@ -736,9 +736,10 @@ int nfs_cached_lookup(struct inode *dir, struct dentry *dentry,
res = -EIO;
if (PageUptodate(page)) {
desc.ptr = kmap_atomic(page, KM_USER0);
void * kaddr = kmap_atomic(page, KM_USER0);
desc.ptr = kaddr;
res = find_dirent_name(&desc, page, dentry);
kunmap_atomic(desc.ptr, KM_USER0);
kunmap_atomic(kaddr, KM_USER0);
}
page_cache_release(page);
......
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