summaryrefslogtreecommitdiff
path: root/arch/um/include
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-02-23 10:37:19 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-21 05:29:50 +0400
commitac2aca2817ca10ad30f86d0d3caa41ea8cc4f0f0 (patch)
treed48719c7b748d4bd99aa176fda481b25dbecd1c3 /arch/um/include
parentea6fb41752dda2e450bd8a318c7400f8cfa9111e (diff)
downloadlinux-ac2aca2817ca10ad30f86d0d3caa41ea8cc4f0f0.tar.xz
um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it
... while calling uml_dup_mmap() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/um/include')
-rw-r--r--arch/um/include/asm/mmu_context.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm/mmu_context.h
index 591b3d8d7614..aa4a743dc4ab 100644
--- a/arch/um/include/asm/mmu_context.h
+++ b/arch/um/include/asm/mmu_context.h
@@ -9,7 +9,7 @@
#include <linux/sched.h>
#include <asm/mmu.h>
-extern void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm);
+extern void uml_setup_stubs(struct mm_struct *mm);
extern void arch_exit_mmap(struct mm_struct *mm);
#define deactivate_mm(tsk,mm) do { } while (0)
@@ -23,7 +23,9 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
* when the new ->mm is used for the first time.
*/
__switch_mm(&new->context.id);
- arch_dup_mmap(old, new);
+ down_write(&new->mmap_sem);
+ uml_setup_stubs(new);
+ up_write(&new->mmap_sem);
}
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
@@ -39,6 +41,11 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
}
}
+static inline void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
+{
+ uml_setup_stubs(mm);
+}
+
static inline void enter_lazy_tlb(struct mm_struct *mm,
struct task_struct *tsk)
{