Commit dee20035b42d569984d2c16041b51e4d75e233b5

Authored by Richard Weinberger
1 parent 3179ce7254

um: Mark stub pages mapping with VM_PFNMAP

Ensure that a process cannot destroy his stub pages with
using MADV_DONTNEED and friends.

Reported-by: toralf.foerster@gmx.de
Signed-off-by: Richard Weinberger <richard@nod.at>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

arch/um/kernel/skas/mmu.c
... ... @@ -123,7 +123,7 @@
123 123 /* dup_mmap already holds mmap_sem */
124 124 err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START,
125 125 VM_READ | VM_MAYREAD | VM_EXEC |
126   - VM_MAYEXEC | VM_DONTCOPY,
  126 + VM_MAYEXEC | VM_DONTCOPY | VM_PFNMAP,
127 127 mm->context.stub_pages);
128 128 if (err) {
129 129 printk(KERN_ERR "install_special_mapping returned %d\n", err);