mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] pfnmap: cow_user_page needs mask
Date: Tue, 29 Nov 2005 16:53:56 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0511291653160.5527@goblin.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0511291650400.5527@goblin.wat.veritas.com>

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);

  reply	other threads:[~2005-11-29 16:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-29 16:53 [PATCH 1/4] pfnmap: fix 2.6.15-rc3 driver breakage Hugh Dickins
2005-11-29 16:53 ` Hugh Dickins [this message]
2005-11-29 16:54 ` [PATCH 3/4] pfnmap: remove src_page from do_wp_page Hugh Dickins
2005-11-29 16:55 ` [PATCH 4/4] pfnmap: do_no_page BUG_ON again Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0511291653160.5527@goblin.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®