[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090113182130.GC13157@linux-os.sc.intel.com>
Date: Tue, 13 Jan 2009 10:21:30 -0800
From: Suresh Siddha <suresh.b.siddha@...el.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: "pageexec@...email.hu" <pageexec@...email.hu>,
"Siddha, Suresh B" <suresh.b.siddha@...el.com>,
"hpa@...or.com" <hpa@...or.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Pallipadi, Venkatesh" <venkatesh.pallipadi@...el.com>,
"Daniel.Beschorner@...ton.com" <Daniel.Beschorner@...ton.com>,
"stable@...nel.org" <stable@...nel.org>
Subject: Re: [patch] x86: fix PTE corruption issue while mapping RAM using /dev/mem
On Mon, Jan 12, 2009 at 04:31:47PM -0800, Ingo Molnar wrote:
>
> Suresh, could you please resend against tip/master? Thanks,
Ok. Here it is:
---
From: Suresh Siddha <suresh.b.siddha@...el.com>
Subject: x86: fix PTE corruption issue while mapping RAM using /dev/mem
Beschorner Daniel reported:
> hwinfo problem since 2.6.28, showing this in the oops:
> Corrupted page table at address 7fd04de3ec00
PaX Team reported a regression with this commit:
> commit 9542ada803198e6eba29d3289abb39ea82047b92
> Author: Suresh Siddha <suresh.b.siddha@...el.com>
> Date: Wed Sep 24 08:53:33 2008 -0700
>
> x86: track memtype for RAM in page struct
This commit breaks mapping any RAM page through /dev/mem, as the
reserve_memtype() was not initializing the return attribute type and as such
corrupting the PTE entry that was setup with the return attribute type.
Because of this bug, application mapping this RAM page through /dev/mem
will die with "Corrupted page table at address xxxx" message in the kernel
log and also the kernel identity mapping which maps the underlying RAM
page gets converted to UC.
Fix this by initializing the return attribute type before calling
reserve_ram_pages_type()
Reported-by: PaX Team <pageexec@...email.hu>
Reported-and-tested-by: Beschorner Daniel <Daniel.Beschorner@...ton.com>
Tested-and-Acked-by: PaX Team <pageexec@...email.hu>
Signed-off-by: Suresh Siddha <suresh.b.siddha@...el.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
Cc: <stable@...nel.org>
---
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index ec8cd49..c2a0538 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -333,6 +333,9 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
req_type & _PAGE_CACHE_MASK);
}
+ if (new_type)
+ *new_type = actual_type;
+
/*
* For legacy reasons, some parts of the physical address range in the
* legacy 1MB region is treated as non-RAM (even when listed as RAM in
@@ -356,9 +359,6 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
new->end = end;
new->type = actual_type;
- if (new_type)
- *new_type = actual_type;
-
spin_lock(&memtype_lock);
if (cached_entry && start >= cached_start)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists