[PATCH 2/3] Fix /proc/pid/pagemap header copy to userspace

From: Dave Boutcher
Date: Mon Aug 06 2007 - 02:45:53 EST


Earlier code relied on a broken length calculation copy
/proc/pid/pagemap header data to userspace. This fix
correctly calls the add_to_pagemap routine after the header data is
set to copy results to userspace in a sane fashion.

Signed-off-by: Dave Boutcher <boutcher@xxxxxxxxxx>
---
fs/proc/task_mmu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index b2baeab..1f78cb4 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -657,11 +657,11 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
pm.out = buf;

if (svpfn == -1) {
- add_to_pagemap(pm.next, 0, &pm);
((char *)page)[0] = (ntohl(1) != 1);
((char *)page)[1] = PAGE_SHIFT;
((char *)page)[2] = sizeof(unsigned long);
((char *)page)[3] = sizeof(unsigned long);
+ add_to_pagemap(pm.next, page[0], &pm);
}

down_read(&mm->mmap_sem);
--
1.4.4.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/