48 lines
1.3 KiB
Diff
48 lines
1.3 KiB
Diff
Subject: mm-protect-activate-switch-mm.patch
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
Date: Mon, 04 Jul 2011 09:48:40 +0200
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
---
|
|
fs/exec.c | 2 ++
|
|
mm/mmu_context.c | 2 ++
|
|
2 files changed, 4 insertions(+)
|
|
|
|
Index: linux-3.2/fs/exec.c
|
|
===================================================================
|
|
--- linux-3.2.orig/fs/exec.c
|
|
+++ linux-3.2/fs/exec.c
|
|
@@ -837,10 +837,12 @@ static int exec_mmap(struct mm_struct *m
|
|
}
|
|
}
|
|
task_lock(tsk);
|
|
+ local_irq_disable_rt();
|
|
active_mm = tsk->active_mm;
|
|
tsk->mm = mm;
|
|
tsk->active_mm = mm;
|
|
activate_mm(active_mm, mm);
|
|
+ local_irq_enable_rt();
|
|
task_unlock(tsk);
|
|
arch_pick_mmap_layout(mm);
|
|
if (old_mm) {
|
|
Index: linux-3.2/mm/mmu_context.c
|
|
===================================================================
|
|
--- linux-3.2.orig/mm/mmu_context.c
|
|
+++ linux-3.2/mm/mmu_context.c
|
|
@@ -26,6 +26,7 @@ void use_mm(struct mm_struct *mm)
|
|
struct task_struct *tsk = current;
|
|
|
|
task_lock(tsk);
|
|
+ local_irq_disable_rt();
|
|
active_mm = tsk->active_mm;
|
|
if (active_mm != mm) {
|
|
atomic_inc(&mm->mm_count);
|
|
@@ -33,6 +34,7 @@ void use_mm(struct mm_struct *mm)
|
|
}
|
|
tsk->mm = mm;
|
|
switch_mm(active_mm, mm, tsk);
|
|
+ local_irq_enable_rt();
|
|
task_unlock(tsk);
|
|
|
|
if (active_mm != mm)
|