From: Chris Wright <chrisw@osdl.org>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Chuck Wolber <chuckw@quantumlinux.com>,
torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
William Lee Irwin III <wli@holomorphy.com>
Subject: [patch 01/09] try_to_unmap_cluster() passes out-of-bounds pte to pte_unmap()
Date: Wed, 8 Jun 2005 16:52:06 -0700 [thread overview]
Message-ID: <20050608235206.GH13152@shell0.pdx.osdl.net> (raw)
In-Reply-To: <20050608234637.GG13152@shell0.pdx.osdl.net>
try_to_unmap_cluster() does:
for (pte = pte_offset_map(pmd, address);
address < end; pte++, address += PAGE_SIZE) {
...
}
pte_unmap(pte);
It may take a little staring to notice, but pte can actually fall off the
end of the pte page in this iteration, which makes life difficult for
kmap_atomic() and the users not expecting it to BUG(). Of course, we're
somewhat lucky in that arithmetic elsewhere in the function guarantees that
at least one iteration is made, lest this force larger rearrangements to be
made. This issue and patch also apply to non-mm mainline and with trivial
adjustments, at least two related kernels.
Discovered during internal testing at Oracle.
Signed-off-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- gregkh-2.6.11.10.orig/mm/rmap.c 2005-05-16 10:51:55.000000000 -0700
+++ gregkh-2.6.11.10/mm/rmap.c 2005-05-26 22:01:49.000000000 -0700
@@ -641,7 +641,7 @@
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
- pte_t *pte;
+ pte_t *pte, *original_pte;
pte_t pteval;
struct page *page;
unsigned long address;
@@ -673,7 +673,7 @@
if (!pmd_present(*pmd))
goto out_unlock;
- for (pte = pte_offset_map(pmd, address);
+ for (original_pte = pte = pte_offset_map(pmd, address);
address < end; pte++, address += PAGE_SIZE) {
if (!pte_present(*pte))
@@ -710,7 +710,7 @@
(*mapcount)--;
}
- pte_unmap(pte);
+ pte_unmap(original_pte);
out_unlock:
spin_unlock(&mm->page_table_lock);
next prev parent reply other threads:[~2005-06-08 23:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-08 23:46 [00/09] -stable review Chris Wright
2005-06-08 23:52 ` Chris Wright [this message]
2005-06-08 23:55 ` [patch 02/09] [NETFILTER]: Fix deadlock with ip_queue and tcp local input path Chris Wright
2005-06-09 0:00 ` [patch 03/09] fix hfsplus oops, hfs and hfsplus leak Chris Wright
2005-06-09 0:04 ` [patch 04/09] x86_64: avoid SMP boot up race Chris Wright
2005-09-14 3:13 ` Horms
2005-09-14 6:29 ` Chris Wright
2005-06-09 0:08 ` [patch 05/09] x86_64: Fix ptrace boundary check Chris Wright
2005-06-09 0:14 ` [patch 06/09] Fix for bttv driver (v0.9.15) for Leadtek WinFast VC100 XP capture cards Chris Wright
2005-06-09 0:18 ` [patch 07/09] ext3: fix log_do_checkpoint() assertion failure Chris Wright
2005-06-09 0:21 ` [patch 08/09] [BRIDGE]: prevent bad forwarding table updates Chris Wright
2005-06-09 0:24 ` [patch 09/09] [PKT_SCHED]: netem: duplication fix Chris Wright
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=20050608235206.GH13152@shell0.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=chuckw@quantumlinux.com \
--cc=jmforbes@linuxtx.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
--cc=stable@kernel.org \
--cc=torvalds@osdl.org \
--cc=tytso@mit.edu \
--cc=wli@holomorphy.com \
--cc=zwane@arm.linux.org.uk \
/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