lkml.org 
[lkml]   [2020]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] MIPS: Add writable-applies-readable policy with pgrot
Date
On Linux system, writable applies readable privilege in most
architectures, this patch adds this policy on MIPS platform
where hardware rixi is supported.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
arch/mips/mm/cache.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index f814e43..dae0617 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -160,7 +160,7 @@ static inline void setup_protection_map(void)
if (cpu_has_rixi) {
protection_map[0] = __pgprot(__PC | __PP | __NX | __NR);
protection_map[1] = __pgprot(__PC | __PP | __NX | ___R);
- protection_map[2] = __pgprot(__PC | __PP | __NX | __NR);
+ protection_map[2] = __pgprot(__PC | __PP | __NX | ___R);
protection_map[3] = __pgprot(__PC | __PP | __NX | ___R);
protection_map[4] = __pgprot(__PC | __PP | ___R);
protection_map[5] = __pgprot(__PC | __PP | ___R);
@@ -169,7 +169,7 @@ static inline void setup_protection_map(void)

protection_map[8] = __pgprot(__PC | __PP | __NX | __NR);
protection_map[9] = __pgprot(__PC | __PP | __NX | ___R);
- protection_map[10] = __pgprot(__PC | __PP | __NX | ___W | __NR);
+ protection_map[10] = __pgprot(__PC | __PP | __NX | ___W | ___R);
protection_map[11] = __pgprot(__PC | __PP | __NX | ___W | ___R);
protection_map[12] = __pgprot(__PC | __PP | ___R);
protection_map[13] = __pgprot(__PC | __PP | ___R);
--
1.8.3.1
\
 
 \ /
  Last update: 2020-06-05 11:13    [W:0.047 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site