Re: [PATCH 1/4] pagemap: Require reads of /proc/pid/pagemap to be multiples of 8 (v2 of series)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Matt Mackall
Date: Thursday, June 5, 2008 - 1:51 pm

On Thu, 2008-06-05 at 12:37 -0700, Andrew Morton wrote:

This one is for 2.6.26. Something more like this for 2.6.25.x:

Because put_user bases its copy size on the size of the target pointer,
not the source, it was copying only 1 byte rather than the intended 8.

Spotted-by: Thomas Tuttle <ttuttle@google.com>
Signed-off-by: Matt Mackall <mpm@selenic.com>

diff -r 5030869d9ded fs/proc/task_mmu.c
--- a/fs/proc/task_mmu.c	Thu Jun 05 04:01:40 2008 +0000
+++ b/fs/proc/task_mmu.c	Thu Jun 05 15:45:00 2008 -0500
@@ -531,7 +531,7 @@
 		return PM_END_OF_BUFFER;
 	}
 
-	if (put_user(pfn, pm->out))
+	if (put_user(pfn, (u64 *)pm->out))
 		return -EFAULT;
 	pm->out += PM_ENTRY_BYTES;
 	return 0;


-- 
Mathematics is the supreme nostalgia of our time.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/4] pagemap: Require reads of /proc/pid/pagema ..., Matt Mackall, (Thu Jun 5, 1:51 pm)