| 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-stable/fs/exec.c |
| =================================================================== |
| --- linux-stable.orig/fs/exec.c |
| +++ linux-stable/fs/exec.c |
| @@ -836,10 +836,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-stable/mm/mmu_context.c |
| =================================================================== |
| --- linux-stable.orig/mm/mmu_context.c |
| +++ linux-stable/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) |