summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-04-06 01:28:34 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-04-06 01:28:34 +0200
commita35cd0f861b6ded0811b5c365635e53710d0e157 (patch)
tree89d81b2bf1fd1afacde4137f9d8a4b48b13ca052
parent0ba08200707e5d761cbe39d6b08174f8eb868125 (diff)
pc: zero rampage() memory (thanks LordCreepity)
memory returned by rampage() is not zeroed, so we have to zero it ourselfs. apparently, this bug didnt show up as we where zeroing conventional low memory before the new memory map code. also rampage() never returns nil.
-rw-r--r--sys/src/9/pc/mmu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/src/9/pc/mmu.c b/sys/src/9/pc/mmu.c
index edcf866db..c0b13674a 100644
--- a/sys/src/9/pc/mmu.c
+++ b/sys/src/9/pc/mmu.c
@@ -524,8 +524,7 @@ mmuwalk(ulong* pdb, ulong va, int level, int create)
panic("mmuwalk2: va %luX entry %luX", va, *table);
if(!(*table & PTEVALID)){
map = rampage();
- if(map == nil)
- panic("mmuwalk: page alloc failed");
+ memset(map, 0, BY2PG);
*table = PADDR(map)|PTEWRITE|PTEVALID;
}
table = KADDR(PPN(*table));