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] Fix buf in zeromap_pud_range() losing virtual address
Date: Thu, 17 Feb 2005 18:26:31 +1100 [thread overview]
Message-ID: <1108625191.5425.61.camel@gaston> (raw)
Hi !
This patch fixes a nasty bug that took us almost a week to track down on
ppc64, introduced by the 4L page table changes, and resulting in random
memory corruption. All archs that rely on a PTE page's struct page to
contain the mm & address (in mapping/index) will be affected.
zeromap_pud_range() is one of these page tables walking functions that
split the address into a base and an offset. It forgets to add back the
"base" when calling the lower level zeromap_pmd_range(), thus passing a
bogus virtual address. Most archs won't care, unless they do the above,
since the lower level can allocate a PTE page.
Kudo's to Michael Ellerman too who spent that week running tests after
tests to track it down, since the only way we managed to get it to show
up was after about 1 to 2h of LTP runs ...
(Note: We are in _urgent_ need to consolidate all those page table
walking functions, they all do things in a subtely different way, with
different checks (sometimes redudant) and inconsitent with each other,
even within a given set of them. Hopefully, Nick has some work in
progress there).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-work/mm/memory.c
===================================================================
--- linux-work.orig/mm/memory.c 2005-02-16 14:51:37.000000000 +1100
+++ linux-work/mm/memory.c 2005-02-17 18:11:15.000000000 +1100
@@ -1041,7 +1041,8 @@
error = -ENOMEM;
if (!pmd)
break;
- error = zeromap_pmd_range(mm, pmd, address, end - address, prot);
+ error = zeromap_pmd_range(mm, pmd, base + address,
+ end - address, prot);
if (error)
break;
address = (address + PUD_SIZE) & PUD_MASK;
next reply other threads:[~2005-02-17 7:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-17 7:26 Benjamin Herrenschmidt [this message]
2005-02-17 8:33 ` [PATCH] Fix buf in zeromap_pud_range() losing virtual address Andi Kleen
2005-02-17 8:40 ` Benjamin Herrenschmidt
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=1108625191.5425.61.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