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()."
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);