summaryrefslogtreecommitdiff
path: root/sys/src/9/port/sysproc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-08-27 06:16:20 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-08-27 06:16:20 +0200
commitd9fec3c70aebe9e9139429235b881bf5b32dbe41 (patch)
tree1c5aadcecee46f50968a4fb1ada922886dca46d2 /sys/src/9/port/sysproc.c
parentd25ca13ed8acdf609329055ef9c36d0f3fae9503 (diff)
kernel: prohibit changing cache attributes (SG_CACHED|SG_DEVICE) in segattach(), set SG_RONLY in data2txt()
the user should not be able to change the cache attributes for a segment in segattach() as this can cause the same memory to be mapped with conflicting attributes in the cache. SG_TEXT should always be mapped with SG_RONLY attribute. so fix data2txt() to follow the rules.
Diffstat (limited to 'sys/src/9/port/sysproc.c')
-rw-r--r--sys/src/9/port/sysproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/9/port/sysproc.c b/sys/src/9/port/sysproc.c
index 259b2d891..5361429c4 100644
--- a/sys/src/9/port/sysproc.c
+++ b/sys/src/9/port/sysproc.c
@@ -512,7 +512,7 @@ sysexec(va_list list)
/* Text. Shared. Attaches to cache image if possible */
/* attachimage returns a locked cache image */
- img = attachimage(SG_TEXT|SG_RONLY, tc, UTZERO, (t-UTZERO)>>PGSHIFT);
+ img = attachimage(SG_TEXT | SG_RONLY, tc, UTZERO, (t-UTZERO)>>PGSHIFT);
ts = img->s;
up->seg[TSEG] = ts;
ts->flushme = 1;