aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mm/fault.c2
-rw-r--r--arch/arm26/mm/fault.c2
-rw-r--r--arch/i386/mm/fault.c2
-rw-r--r--arch/ia64/mm/fault.c6
-rw-r--r--arch/m68k/mm/fault.c2
-rw-r--r--arch/powerpc/mm/fault.c2
-rw-r--r--arch/ppc/mm/fault.c2
-rw-r--r--arch/sh/mm/fault.c2
-rw-r--r--arch/x86_64/mm/fault.c2
9 files changed, 12 insertions, 10 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index f0943d160ffe..a5b33ff3924e 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -171,7 +171,7 @@ good_area:
171 if (fsr & (1 << 11)) /* write? */ 171 if (fsr & (1 << 11)) /* write? */
172 mask = VM_WRITE; 172 mask = VM_WRITE;
173 else 173 else
174 mask = VM_READ|VM_EXEC; 174 mask = VM_READ|VM_EXEC|VM_WRITE;
175 175
176 fault = VM_FAULT_BADACCESS; 176 fault = VM_FAULT_BADACCESS;
177 if (!(vma->vm_flags & mask)) 177 if (!(vma->vm_flags & mask))
diff --git a/arch/arm26/mm/fault.c b/arch/arm26/mm/fault.c
index 761938b56679..a7c4cc922095 100644
--- a/arch/arm26/mm/fault.c
+++ b/arch/arm26/mm/fault.c
@@ -155,7 +155,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
155 */ 155 */
156good_area: 156good_area:
157 if (READ_FAULT(fsr)) /* read? */ 157 if (READ_FAULT(fsr)) /* read? */
158 mask = VM_READ|VM_EXEC; 158 mask = VM_READ|VM_EXEC|VM_WRITE;
159 else 159 else
160 mask = VM_WRITE; 160 mask = VM_WRITE;
161 161
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index 5e17a3f43b41..50d8617391dd 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -440,7 +440,7 @@ good_area:
440 case 1: /* read, present */ 440 case 1: /* read, present */
441 goto bad_area; 441 goto bad_area;
442 case 0: /* read, not present */ 442 case 0: /* read, not present */
443 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 443 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
444 goto bad_area; 444 goto bad_area;
445 } 445 }
446 446
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index 14ef7cceb208..d8b1b4ac7f26 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -146,9 +146,11 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
146# error File is out of sync with <linux/mm.h>. Please update. 146# error File is out of sync with <linux/mm.h>. Please update.
147# endif 147# endif
148 148
149 if (((isr >> IA64_ISR_R_BIT) & 1UL) && (!(vma->vm_flags & (VM_READ | VM_WRITE))))
150 goto bad_area;
151
149 mask = ( (((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT) 152 mask = ( (((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT)
150 | (((isr >> IA64_ISR_W_BIT) & 1UL) << VM_WRITE_BIT) 153 | (((isr >> IA64_ISR_W_BIT) & 1UL) << VM_WRITE_BIT));
151 | (((isr >> IA64_ISR_R_BIT) & 1UL) << VM_READ_BIT));
152 154
153 if ((vma->vm_flags & mask) != mask) 155 if ((vma->vm_flags & mask) != mask)
154 goto bad_area; 156 goto bad_area;
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index aec15270d334..5e2d87c10c87 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -144,7 +144,7 @@ good_area:
144 case 1: /* read, present */ 144 case 1: /* read, present */
145 goto acc_err; 145 goto acc_err;
146 case 0: /* read, not present */ 146 case 0: /* read, not present */
147 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 147 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
148 goto acc_err; 148 goto acc_err;
149 } 149 }
150 150
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 78a0d59903ee..77953f41d754 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -333,7 +333,7 @@ good_area:
333 /* protection fault */ 333 /* protection fault */
334 if (error_code & 0x08000000) 334 if (error_code & 0x08000000)
335 goto bad_area; 335 goto bad_area;
336 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 336 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
337 goto bad_area; 337 goto bad_area;
338 } 338 }
339 339
diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c
index 5cdfb71fcb07..bc776beb3136 100644
--- a/arch/ppc/mm/fault.c
+++ b/arch/ppc/mm/fault.c
@@ -239,7 +239,7 @@ good_area:
239 /* protection fault */ 239 /* protection fault */
240 if (error_code & 0x08000000) 240 if (error_code & 0x08000000)
241 goto bad_area; 241 goto bad_area;
242 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 242 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
243 goto bad_area; 243 goto bad_area;
244 } 244 }
245 245
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index c69fd603226a..507f28914706 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -69,7 +69,7 @@ good_area:
69 if (!(vma->vm_flags & VM_WRITE)) 69 if (!(vma->vm_flags & VM_WRITE))
70 goto bad_area; 70 goto bad_area;
71 } else { 71 } else {
72 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 72 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
73 goto bad_area; 73 goto bad_area;
74 } 74 }
75 75
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 1a17b0733ab5..9ba54cc2b5f6 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -464,7 +464,7 @@ good_area:
464 case PF_PROT: /* read, present */ 464 case PF_PROT: /* read, present */
465 goto bad_area; 465 goto bad_area;
466 case 0: /* read, not present */ 466 case 0: /* read, not present */
467 if (!(vma->vm_flags & (VM_READ | VM_EXEC))) 467 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
468 goto bad_area; 468 goto bad_area;
469 } 469 }
470 470