aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-07-20 07:09:15 -0400
committerRichard Weinberger <richard@nod.at>2014-07-20 07:09:15 -0400
commit284e6d39516cc7f9fbceebb259849fcb41559a7b (patch)
treeb921cdd0911583d68e3de7fb48a9ef67b0883bd6 /arch
parentae5db6d12341684913a78b6537c0b9c22c999b5c (diff)
um: Ensure that a stub page cannot get unmapped
Trinity discovered an execution path such that a task can unmap his stub page. Reported-by: Toralf Förster <toralf.foerster@gmx.de> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/kernel/tlb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 9472079471bb..1fc619e5dfe9 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -124,6 +124,9 @@ static int add_munmap(unsigned long addr, unsigned long len,
124 struct host_vm_op *last; 124 struct host_vm_op *last;
125 int ret = 0; 125 int ret = 0;
126 126
127 if ((addr >= STUB_START) && (addr < STUB_END))
128 return -EINVAL;
129
127 if (hvc->index != 0) { 130 if (hvc->index != 0) {
128 last = &hvc->ops[hvc->index - 1]; 131 last = &hvc->ops[hvc->index - 1];
129 if ((last->type == MUNMAP) && 132 if ((last->type == MUNMAP) &&