[PATCH 2/4] pfnmap: cow_user_page needs mask
From: Hugh Dickins (hugh_at_veritas.com)
Date: 11/29/05
- Previous message: thockin_at_hockin.org: "Re: [RT] read_tsc: ACK! TSC went backward! Unsynced TSCs?"
- In reply to: Hugh Dickins: "[PATCH 1/4] pfnmap: fix 2.6.15-rc3 driver breakage"
- Next in thread: Hugh Dickins: "[PATCH 4/4] pfnmap: do_no_page BUG_ON again"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 29 Nov 2005 16:53:56 +0000 (GMT) To: Linus Torvalds <torvalds@osdl.org>
The fault address to cow_user_page is not usually page aligned, so needs
to be masked in the unusual case when that copies via the user address.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
mm/memory.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
--- 2.6.15-rc3/mm/memory.c 2005-11-29 08:40:07.000000000 +0000
+++ linux/mm/memory.c 2005-11-29 15:59:34.000000000 +0000
@@ -1300,7 +1313,8 @@ static inline void cow_user_page(struct
*/
if (unlikely(!src)) {
void *kaddr = kmap_atomic(dst, KM_USER0);
- unsigned long left = __copy_from_user_inatomic(kaddr, (void __user *)va, PAGE_SIZE);
+ unsigned long left = __copy_from_user_inatomic(kaddr,
+ (void __user *)(va & PAGE_MASK), PAGE_SIZE);
if (left)
memset(kaddr, 0, PAGE_SIZE);
kunmap_atomic(kaddr, KM_USER0);
-
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/
- Previous message: thockin_at_hockin.org: "Re: [RT] read_tsc: ACK! TSC went backward! Unsynced TSCs?"
- In reply to: Hugh Dickins: "[PATCH 1/4] pfnmap: fix 2.6.15-rc3 driver breakage"
- Next in thread: Hugh Dickins: "[PATCH 4/4] pfnmap: do_no_page BUG_ON again"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]