Skip to content

Commit

Permalink
MIPS: vdso: Use vma page protection for remapping
Browse files Browse the repository at this point in the history
MIPS protection bits are setup during runtime so using defines like
PAGE_READONLY ignores these runtime changes. To fix this we simply
use the page protection of the setup vma.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Thomas Bogendoerfer committed Nov 19, 2020
1 parent 8c9e8b0 commit 724d554
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/mips/kernel/vdso.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
gic_pfn = virt_to_phys(mips_gic_base + MIPS_GIC_USER_OFS) >> PAGE_SHIFT;

ret = io_remap_pfn_range(vma, base, gic_pfn, gic_size,
pgprot_noncached(PAGE_READONLY));
pgprot_noncached(vma->vm_page_prot));
if (ret)
goto out;
}

/* Map data page. */
ret = remap_pfn_range(vma, data_addr,
virt_to_phys(vdso_data) >> PAGE_SHIFT,
PAGE_SIZE, PAGE_READONLY);
PAGE_SIZE, vma->vm_page_prot);
if (ret)
goto out;

Expand Down

0 comments on commit 724d554

Please sign in to comment.