From: Ingo Molnar <mingo@elte.hu>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Greg KH <greg@kroah.com>,
stable@kernel.org, torvalds@osdl.org,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>
Subject: Re: [PATCH RESEND] early_ioremap has a fencepost error
Date: Fri, 10 Oct 2008 12:21:28 +0200 [thread overview]
Message-ID: <20081010102128.GA22856@elte.hu> (raw)
In-Reply-To: <20081010104645.139704c0@lxorguk.ukuu.org.uk>
* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> Can we get this into 2.6.27.x at some point as its a regression and a
> crash on boot for some users moving from 2.6.26
yes, have your fix patch from yesterday in tip/x86/urgent already, with
a stable@kernel.org tag included as well - see below. Thanks Alan!
Ingo
-------------->
>From dd5698f42a5f2b494c3e811598403f105b00f4f2 Mon Sep 17 00:00:00 2001
From: Alan Cox <alan@redhat.com>
Date: Fri, 10 Oct 2008 10:46:45 +0100
Subject: [PATCH] x86, early_ioremap: fix fencepost error
The x86 implementation of early_ioremap has an off by one error. If we get
an object which ends on the first byte of a page we undermap by one page and
this causes a crash on boot with the ASUS P5QL whose DMI table happens to fit
this alignment.
The size computation is currently
last_addr = phys_addr + size - 1;
npages = (PAGE_ALIGN(last_addr) - phys_addr)
(Consider a request for 1 byte at alignment 0...)
Closes #11693
Debugging work by Ian Campbell/Felix Geyer
Signed-off-by: Alan Cox <alan@rehat.com>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/mm/ioremap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index d4b6e6a..d0975fc 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -595,7 +595,7 @@ void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
*/
offset = phys_addr & ~PAGE_MASK;
phys_addr &= PAGE_MASK;
- size = PAGE_ALIGN(last_addr) - phys_addr;
+ size = PAGE_ALIGN(last_addr + 1) - phys_addr;
/*
* Mappings have to fit in the FIX_BTMAP area.
next prev parent reply other threads:[~2008-10-10 10:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-03 19:16 Markers in (non-module) kernel code? Theodore Ts'o
2008-10-03 19:54 ` [PATCH] Marker depmod fix core kernel list Mathieu Desnoyers
2008-10-04 15:24 ` Theodore Tso
2008-10-06 4:08 ` Greg KH
2008-10-10 9:39 ` Ingo Molnar
2008-10-10 9:39 ` Ingo Molnar
2008-10-10 15:48 ` Greg KH
2008-10-10 9:46 ` [PATCH RESEND] early_ioremap has a fencepost error Alan Cox
2008-10-10 10:21 ` Ingo Molnar [this message]
2008-10-06 20:23 ` [PATCH] Marker depmod fix core kernel list Roland McGrath
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=20081010102128.GA22856@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@osdl.org \
--cc=yinghai@kernel.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