From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] Check for wraps in copy_page_range
Date: Thu, 17 Feb 2005 18:20:40 +1100 [thread overview]
Message-ID: <1108624841.5382.54.camel@gaston> (raw)
Hi !
While browsing the 4 level page table changes (looking for a bug), I
noticed that copy_page_range, unlike others, do not check for
wraparound, which I suppose could be a problem with 4G/4G architectures
or that sort of thing.
This patch fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-work/mm/memory.c
===================================================================
--- linux-work.orig/mm/memory.c 2005-02-03 15:48:17.000000000 +1100
+++ linux-work/mm/memory.c 2005-02-16 14:51:37.000000000 +1100
@@ -358,7 +358,7 @@
for (; addr < end; addr = next, src_pmd++, dst_pmd++) {
next = (addr + PMD_SIZE) & PMD_MASK;
- if (next > end)
+ if (next > end || next <= addr)
next = end;
if (pmd_none(*src_pmd))
continue;
@@ -390,7 +390,7 @@
for (; addr < end; addr = next, src_pud++, dst_pud++) {
next = (addr + PUD_SIZE) & PUD_MASK;
- if (next > end)
+ if (next > end || next <= addr)
next = end;
if (pud_none(*src_pud))
continue;
reply other threads:[~2005-02-17 7:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1108624841.5382.54.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--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