Commit dee20035 authored by Richard Weinberger's avatar Richard Weinberger

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: default avatarRichard Weinberger <richard@nod.at>
parent 3179ce72
...@@ -123,7 +123,7 @@ void uml_setup_stubs(struct mm_struct *mm) ...@@ -123,7 +123,7 @@ void uml_setup_stubs(struct mm_struct *mm)
/* dup_mmap already holds mmap_sem */ /* dup_mmap already holds mmap_sem */
err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START, err = install_special_mapping(mm, STUB_START, STUB_END - STUB_START,
VM_READ | VM_MAYREAD | VM_EXEC | VM_READ | VM_MAYREAD | VM_EXEC |
VM_MAYEXEC | VM_DONTCOPY, VM_MAYEXEC | VM_DONTCOPY | VM_PFNMAP,
mm->context.stub_pages); mm->context.stub_pages);
if (err) { if (err) {
printk(KERN_ERR "install_special_mapping returned %d\n", err); printk(KERN_ERR "install_special_mapping returned %d\n", err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment