[patch 16/21] parisc: disable UP-optimized flush_tlb_mm

From: Greg KH
Date: Mon Jan 12 2009 - 20:35:26 EST


2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Kyle McMartin <kyle@xxxxxxxxxxxxx>

commit 5289f46b9de04bde181d833d48df9671b69c4b08 upstream.

flush_tlb_mm's "optimized" uniprocessor case of allocating a new
context for userspace is exposing a race where we can suddely return
to a syscall with the protection id and space id out of sync, trapping
on the next userspace access.

Debugged-by: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
Tested-by: Helge Deller <deller@xxxxxx>
Signed-off-by: Kyle McMartin <kyle@xxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
include/asm-parisc/tlbflush.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

--- a/include/asm-parisc/tlbflush.h
+++ b/include/asm-parisc/tlbflush.h
@@ -44,9 +44,12 @@ static inline void flush_tlb_mm(struct m
{
BUG_ON(mm == &init_mm); /* Should never happen */

-#ifdef CONFIG_SMP
+#if 1 || defined(CONFIG_SMP)
flush_tlb_all();
#else
+ /* FIXME: currently broken, causing space id and protection ids
+ * to go out of sync, resulting in faults on userspace accesses.
+ */
if (mm) {
if (mm->context != 0)
free_sid(mm->context);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/