Skip to content

Commit

Permalink
um: Ensure that a stub page cannot get unmapped
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Richard Weinberger committed Jul 20, 2014
1 parent ae5db6d commit 284e6d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/um/kernel/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ static int add_munmap(unsigned long addr, unsigned long len,
struct host_vm_op *last;
int ret = 0;

if ((addr >= STUB_START) && (addr < STUB_END))
return -EINVAL;

if (hvc->index != 0) {
last = &hvc->ops[hvc->index - 1];
if ((last->type == MUNMAP) &&
Expand Down

0 comments on commit 284e6d3

Please sign in to comment.