public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Thomas Schlichter <thomas.schlichter@web.de>
Cc: linux-kernel@vger.kernel.org,
	Zwane Mwaikambo <zwane@holomorphy.com>, Andi Kleen <ak@muc.de>
Subject: Re: 2.6.10-rc1-mm4
Date: Wed, 10 Nov 2004 15:03:07 -0800	[thread overview]
Message-ID: <20041110150307.3a06cc1d.akpm@osdl.org> (raw)
In-Reply-To: <200411102333.03412.thomas.schlichter@web.de>

Thomas Schlichter <thomas.schlichter@web.de> wrote:
>
> Today I tested the linux-2.6.10-rc1-mm4 kernel and it works fine with the 
> attached config. But if I enable HIGHPTE, that kernel hits following BUG 
> (written down by hand) and panics when the INIT process is started:
> 
> kernel BUG at arch/i386/mm/highmem.c:63!
> EIP is at kunmap_atomic+0x27/0x70
> Call Trace
>   show_stack+0xa6/0xb0
>   show_register+0x14d/0x1c0
>   die+0x158/0x2e0
>   do_invalid_op+0xef/0x100
>   error_code+0x2b/0x30
>   copy_pte_range+0x122/0x490

This might help:




We're modifying src_pte and dst_pte in the for-loop, and then unmapping the
modified pointers.  If one of them walked off the end of the page then blam.


Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/mm/memory.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff -puN mm/memory.c~4level-highpte-fix mm/memory.c
--- 25/mm/memory.c~4level-highpte-fix	Wed Nov 10 14:58:55 2004
+++ 25-akpm/mm/memory.c	Wed Nov 10 15:00:58 2004
@@ -332,7 +332,8 @@ static int copy_pte_range(struct mm_stru
 				struct vm_area_struct *vma,
 			   	unsigned long addr, unsigned long end)
 {
-	pte_t * src_pte, * dst_pte;
+	pte_t *src_pte, *dst_pte;
+	pte_t *s, *d;
 	unsigned long vm_flags = vma->vm_flags;
 
 	dst_pte = pte_alloc_map(dst_mm, dst_pmd, addr);
@@ -341,12 +342,12 @@ static int copy_pte_range(struct mm_stru
 
 	spin_lock(&src_mm->page_table_lock);
 	src_pte = pte_offset_map_nested(src_pmd, addr);
-	for (;
-	     addr < end;
-	     addr += PAGE_SIZE, src_pte++, dst_pte++) {
-		if (pte_none(*src_pte))
+	d = dst_pte;
+	s = src_pte;
+	for ( ; addr < end; addr += PAGE_SIZE, s++, d++) {
+		if (pte_none(*s))
 			continue;
-		copy_one_pte(dst_mm, src_mm, dst_pte, src_pte, vm_flags, addr);
+		copy_one_pte(dst_mm, src_mm, d, s, vm_flags, addr);
 	}
 	pte_unmap_nested(src_pte);
 	pte_unmap(dst_pte);
_


  reply	other threads:[~2004-11-10 22:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-10 22:33 2.6.10-rc1-mm4 Thomas Schlichter
2004-11-10 23:03 ` Andrew Morton [this message]
2004-11-12 23:11   ` 2.6.10-rc1-mm4 Andi Kleen
2004-11-12 23:31   ` 2.6.10-rc1-mm4 Zwane Mwaikambo
  -- strict thread matches above, loose matches on Subject: below --
2004-11-09 15:49 2.6.10-rc1-mm4 Andrew Morton
2004-11-09 16:11 ` 2.6.10-rc1-mm4 Jens Axboe
2004-11-09 19:53   ` 2.6.10-rc1-mm4 Andrew Morton
2004-11-09 21:14     ` 2.6.10-rc1-mm4 Jens Axboe
2004-11-09 21:57       ` 2.6.10-rc1-mm4 Jens Axboe
2004-11-10 16:28       ` 2.6.10-rc1-mm4 Jens Axboe
2004-11-09 16:32 ` 2.6.10-rc1-mm4 Jesse Barnes
2004-11-09 16:41 ` 2.6.10-rc1-mm4 Markus Trippelsdorf
2004-11-09 17:02 ` 2.6.10-rc1-mm4 Stefano Rivoir
2004-11-09 23:18   ` 2.6.10-rc1-mm4 Dave Airlie
2004-11-10  1:30     ` 2.6.10-rc1-mm4 Dave Airlie
2004-11-10  7:44     ` 2.6.10-rc1-mm4 Stefano Rivoir
2004-11-11  7:39     ` 2.6.10-rc1-mm4 Stefano Rivoir
2004-11-10 11:40 ` 2.6.10-rc1-mm4 Fabio Coatti
2004-11-10 12:36   ` 2.6.10-rc1-mm4 Rafael J. Wysocki
2004-11-11 10:17 ` 2.6.10-rc1-mm4 Stefano Rivoir
2004-11-11 10:24   ` 2.6.10-rc1-mm4 Andrew Morton

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=20041110150307.3a06cc1d.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.schlichter@web.de \
    --cc=zwane@holomorphy.com \
    /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