lkml.org 
[lkml]   [2007]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 2/3] Fix /proc/pid/pagemap header copy to userspace
From
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@cs.umn.edu>
---
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-06 08:49    [W:2.743 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site