diff options
author | Graf Yang <graf.yang@analog.com> | 2009-07-20 22:26:57 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-09-16 21:31:55 -0400 |
commit | 36b841288656b9b30b5d2add2fd136ac7eab5867 (patch) | |
tree | b3faec0b85a2814216c791de99435e74a43b6148 /arch/blackfin/include | |
parent | 8fc4dd9e876cbda4dfe09ca85e4e1520b36dce77 (diff) |
Blackfin: fix MPU handling of invalid memory accesses
The protect_page() function was incorrectly setting up the hardware tables
based on possible access capabilities rather than the actual requested
values. This means we would grant more access to mmap-ed pages than we
should have. Once we fix this, we need to tweak the signal generated by
such accesses to aline ourselves with other ports. This allows the LTP
mmap0{5,6,7} cases to run properly.
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/include')
-rw-r--r-- | arch/blackfin/include/asm/mmu_context.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/blackfin/include/asm/mmu_context.h b/arch/blackfin/include/asm/mmu_context.h index 944e29faae48..040410bb07e1 100644 --- a/arch/blackfin/include/asm/mmu_context.h +++ b/arch/blackfin/include/asm/mmu_context.h | |||
@@ -127,17 +127,17 @@ static inline void protect_page(struct mm_struct *mm, unsigned long addr, | |||
127 | unsigned long idx = page >> 5; | 127 | unsigned long idx = page >> 5; |
128 | unsigned long bit = 1 << (page & 31); | 128 | unsigned long bit = 1 << (page & 31); |
129 | 129 | ||
130 | if (flags & VM_MAYREAD) | 130 | if (flags & VM_READ) |
131 | mask[idx] |= bit; | 131 | mask[idx] |= bit; |
132 | else | 132 | else |
133 | mask[idx] &= ~bit; | 133 | mask[idx] &= ~bit; |
134 | mask += page_mask_nelts; | 134 | mask += page_mask_nelts; |
135 | if (flags & VM_MAYWRITE) | 135 | if (flags & VM_WRITE) |
136 | mask[idx] |= bit; | 136 | mask[idx] |= bit; |
137 | else | 137 | else |
138 | mask[idx] &= ~bit; | 138 | mask[idx] &= ~bit; |
139 | mask += page_mask_nelts; | 139 | mask += page_mask_nelts; |
140 | if (flags & VM_MAYEXEC) | 140 | if (flags & VM_EXEC) |
141 | mask[idx] |= bit; | 141 | mask[idx] |= bit; |
142 | else | 142 | else |
143 | mask[idx] &= ~bit; | 143 | mask[idx] &= ~bit; |