aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/include/um_mmu.h1
-rw-r--r--arch/um/kernel/skas/mmu.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/um/include/um_mmu.h b/arch/um/include/um_mmu.h
index 82865fcf6872..f575ff91f2a0 100644
--- a/arch/um/include/um_mmu.h
+++ b/arch/um/include/um_mmu.h
@@ -13,6 +13,7 @@
13typedef struct mm_context { 13typedef struct mm_context {
14 struct mm_id id; 14 struct mm_id id;
15 struct uml_ldt ldt; 15 struct uml_ldt ldt;
16 struct page **stub_pages;
16} mm_context_t; 17} mm_context_t;
17 18
18extern void __switch_mm(struct mm_id * mm_idp); 19extern void __switch_mm(struct mm_id * mm_idp);
diff --git a/arch/um/kernel/skas/mmu.c b/arch/um/kernel/skas/mmu.c
index 78b3e9f69d57..0cd9a7a05e77 100644
--- a/arch/um/kernel/skas/mmu.c
+++ b/arch/um/kernel/skas/mmu.c
@@ -91,6 +91,8 @@ int init_new_context(struct task_struct *task, struct mm_struct *mm)
91 goto out_free; 91 goto out_free;
92 } 92 }
93 93
94 to_mm->stub_pages = NULL;
95
94 return 0; 96 return 0;
95 97
96 out_free: 98 out_free:
@@ -126,6 +128,7 @@ void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
126 128
127 pages[0] = virt_to_page(&__syscall_stub_start); 129 pages[0] = virt_to_page(&__syscall_stub_start);
128 pages[1] = virt_to_page(mm->context.id.stack); 130 pages[1] = virt_to_page(mm->context.id.stack);
131 mm->context.stub_pages = pages;
129 132
130 /* dup_mmap already holds mmap_sem */ 133 /* dup_mmap already holds mmap_sem */
131 err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START, 134 err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START,
@@ -147,6 +150,8 @@ void arch_exit_mmap(struct mm_struct *mm)
147{ 150{
148 pte_t *pte; 151 pte_t *pte;
149 152
153 if (mm->context.stub_pages != NULL)
154 kfree(mm->context.stub_pages);
150 pte = virt_to_pte(mm, STUB_CODE); 155 pte = virt_to_pte(mm, STUB_CODE);
151 if (pte != NULL) 156 if (pte != NULL)
152 pte_clear(mm, STUB_CODE, pte); 157 pte_clear(mm, STUB_CODE, pte);