aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mprotect.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-04-11 22:27:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-11 22:27:19 -0400
commit39c853ebfe169f187a760b34f9cbf54751bfce00 (patch)
tree2a5a741d0cff7d4f90998b31b32ff80cfccd0369 /mm/mprotect.c
parentsg_start_req(): use import_iovec() (diff)
parentnew helper: msg_data_left() (diff)
downloadlinux-dev-39c853ebfe169f187a760b34f9cbf54751bfce00.tar.xz
linux-dev-39c853ebfe169f187a760b34f9cbf54751bfce00.zip
Merge branch 'for-davem' into for-next
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r--mm/mprotect.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 44727811bf4c..88584838e704 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -75,6 +75,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
oldpte = *pte;
if (pte_present(oldpte)) {
pte_t ptent;
+ bool preserve_write = prot_numa && pte_write(oldpte);
/*
* Avoid trapping faults against the zero or KSM
@@ -94,6 +95,8 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
ptent = ptep_modify_prot_start(mm, addr, pte);
ptent = pte_modify(ptent, newprot);
+ if (preserve_write)
+ ptent = pte_mkwrite(ptent);
/* Avoid taking write faults for known dirty pages */
if (dirty_accountable && pte_dirty(ptent) &&