linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] MIPS: vdso: Use vma page protection for remapping
@ 2020-11-13 11:09 Thomas Bogendoerfer
  2020-11-13 11:09 ` [PATCH 2/4] MIPS: kvm: Use vm_get_page_prot to get protection bits Thomas Bogendoerfer
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Thomas Bogendoerfer @ 2020-11-13 11:09 UTC (permalink / raw)
  To: linux-mips, linux-kernel

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>
---
 arch/mips/kernel/vdso.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c
index 242dc5e83847..7d0b91ad2581 100644
--- a/arch/mips/kernel/vdso.c
+++ b/arch/mips/kernel/vdso.c
@@ -161,7 +161,7 @@ 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;
 	}
@@ -169,7 +169,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 	/* 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;
 
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-12-14 17:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 11:09 [PATCH 1/4] MIPS: vdso: Use vma page protection for remapping Thomas Bogendoerfer
2020-11-13 11:09 ` [PATCH 2/4] MIPS: kvm: Use vm_get_page_prot to get protection bits Thomas Bogendoerfer
2020-11-14  7:34   ` Huacai Chen
2020-11-16 12:30     ` Thomas Bogendoerfer
2020-11-17  1:18       ` Huacai Chen
2020-11-17 10:40         ` Thomas Bogendoerfer
2020-11-19 12:54   ` Thomas Bogendoerfer
2020-11-13 11:09 ` [PATCH 3/4] MIPS: mm: shorten lines by using macro Thomas Bogendoerfer
2020-11-19 12:54   ` Thomas Bogendoerfer
2020-11-13 11:09 ` [PATCH 4/4] MIPS: mm: Clean up setup of protection map Thomas Bogendoerfer
2020-11-19 12:54   ` Thomas Bogendoerfer
2020-12-12 16:29   ` Guenter Roeck
2020-12-14 15:32     ` Thomas Bogendoerfer
2020-11-19 12:53 ` [PATCH 1/4] MIPS: vdso: Use vma page protection for remapping Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).